-
-
Notifications
You must be signed in to change notification settings - Fork 61
49 lines (40 loc) · 1.19 KB
/
frontend_build_push.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
name: Frontend Build and upload to S3
on:
release:
types: [released]
paths:
- "frontend/**"
- ".github/workflows/frontend_build_push.yml"
permissions:
id-token: write
contents: read
jobs:
build_and_upload:
runs-on: ubuntu-latest
environment: Production
env:
CI: false
strategy:
matrix:
node-version: [16.14.2]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: cd frontend/ && npm install --legacy-peer-deps
- name: Build frontend
run: cd frontend/ && npm run build
env:
REACT_APP_API_BASE: ${{ vars.REACT_APP_API_BASE }}
REACT_APP_PREDICTOR_API_BASE: ${{ vars.REACT_APP_PREDICTOR_API_BASE }}
REACT_APP_ENV: Dev
- name: Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
role-session-name: fAIrGithub
- name: Upload to S3
run: cd frontend/build && aws s3 sync . s3://${{ vars.FRONTEND_BUCKET }}/