-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (75 loc) · 2.03 KB
/
deployment.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
75
76
77
78
79
name: cc-frontend
on:
pull_request:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Load & cache dependencies
id: cache-dependencies
uses: ./.github/actions/cached-dependencies
- name: Build website
run: npm run build
- name: Build export
run: npm run export
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: out-files
path: out
lint:
needs: build
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Load & cache dependencies
id: cache-dependencies
uses: ./.github/actions/cached-dependencies
- name: Lint code
run: npm run lint
deploy-uat:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Get build artifacts
uses: actions/download-artifact@v3
with:
name: out-files
path: out
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::245866473499:role/OIDC-S3-deployment
aws-region: ap-southeast-2
- name: Deploy to PROD S3
run: |
aws s3 sync out ${{ secrets.S3_UAT_ADMIN_BUCKET }}
deploy-prod:
needs: deploy-uat
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Get build artifacts
uses: actions/download-artifact@v3
with:
name: out-files
path: out
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::245866473499:role/OIDC-S3-deployment
aws-region: ap-southeast-2
- name: Deploy to PROD S3
run: |
aws s3 sync out ${{ secrets.S3_PROD_ADMIN_BUCKET }}