-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 1.79 KB
/
frontend.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build Frontend
on:
push:
paths:
- .github/workflows/frontend.yml
- frontend/**
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm ci and npm run build
working-directory: frontend
run: |
npm ci
npm run build
- name: zip release
uses: thedoctor0/zip-release@master
with:
filename: app.zip
directory: frontend/dist/startup-generator-client
- name: upload
uses: actions/upload-artifact@v2
with:
name: frontend-${{ github.run_number }}
path: frontend/dist/startup-generator-client/app.zip
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: frontend-${{ github.run_number }}
- uses: montudor/[email protected]
with:
args: unzip -qq app.zip -d ./app
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWSS3FrontendBucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWSAccessKeyId }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWSSecretKey }}
AWS_REGION: 'us-west-2'
SOURCE_DIR: 'app'