-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (34 loc) · 1.08 KB
/
update-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
name: Update frontend
on:
push:
paths:
- app/**
- .github/workflow/update-frontend.yml
branches:
- live
- stage
- dev
permissions:
id-token: write # This is required for requesting the JWT
jobs:
update_site_env_matching_branch:
environment: ${{ github.ref_name }}
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_NUMBER }}:role/Role_Diagram_GitHub_OICD
aws-region: ${{ secrets.AWS_REGION }}
- name: Install node dependencies
working-directory: ./app
run: npm ci
- name: Build static site
working-directory: ./app
run: npm run build
- name: Update static site hosted in S3
run: aws s3 sync ./app/dist s3://${{ secrets.BUCKET_NAME }}/ --delete