This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (52 loc) · 1.78 KB
/
frontend-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build Frontend Package
on:
push:
paths:
- frontend/**
- examples/**
- .github/workflows/frontend-package.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt update
sudo apt install coreutils p7zip-full qemu-user-static
- name: Checkout Project Repository
uses: actions/checkout@v2
- name: Set Node Version
uses: actions/setup-node@v2
with:
node-version: '14.18.2'
- name: Get SHA
id: get_sha
run: echo "::set-output name=short-sha::$(git rev-parse --short "$GITHUB_SHA")"
- name: Prepare examples directory
run: |
cd examples
npm install --only=production
- name: Package frontend
run: |
mkdir build
zip -r build/mindbeamer-${{ steps.get_sha.outputs.short-sha }}.zip frontend examples
- name: Upload to S3
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: "${{ secrets.AWS_KEY_ID }}"
aws_secret_access_key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
aws_bucket: mindbeamer
source_dir: build
destination_dir: ''
- name: Update Greengrass v2 Component
if: startsWith(github.ref, 'refs/tags/')
run: |
GIT_TAG=$(echo $GITHUB_REF | cut -d / -f 3)
GIT_HASH=${{ steps.get_sha.outputs.short-sha }}
sed -i "s/GIT_TAG/$GIT_TAG/g" greengrass.json
sed -i "s/GIT_HASH/$GIT_HASH/g" greengrass.json
aws greengrassv2 create-component-version --inline-recipe fileb://greengrass.json
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'