-
Notifications
You must be signed in to change notification settings - Fork 28
46 lines (39 loc) · 1.14 KB
/
prod.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
name: Production Deployment
on:
push:
branches:
- master
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.16.0]
steps:
- uses: actions/checkout@v2
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# TODO: update build stage to use new build command
- name: Generate build
run: |
yarn install
yarn run build
env:
CI: false
NODE_OPTIONS: --max_old_space_size=4096
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: production-deploy
aws-region: us-east-1
# publish to prod environment
- name: Deploy to S3
run: |
aws s3 sync build s3://${{ secrets.PROD_S3_BUCKET_NAME }}
aws cloudfront create-invalidation --distribution-id ${{ secrets.PROD_CF_ID }} --paths /