-
Notifications
You must be signed in to change notification settings - Fork 5
42 lines (33 loc) · 1.01 KB
/
main.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
name: wds-code-front-deploy
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
env:
REACT_APP_STAGE: ${{secrets.REACT_APP_STAGE}}
jobs:
run:
runs-on: ubuntu-latest
env:
AWS_DEFAULT_REGION: 'us-east-2'
steps:
- uses: actions/checkout@master
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::116580135187:role/wds-code-remix-github-action-s3-deploy
role-session-name: wds-code-remix-github-action-s3-deploy
aws-region: us-east-2
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: After Build
run: npm run postbuild
- name: Upload file to S3 bucket
run: aws s3 sync ./build s3://${{ secrets.AWS_S3_BUCKET }}
- name: Invalidate cache CloudFront
run: aws cloudfront create-invalidation --distribution-id ${{secrets.DISTRIBUTION_ID}} --paths "/*"