-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 1.96 KB
/
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
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
name: DevHub Frontend CICD
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
name: Static Frontend Build - nodeJS v${{ matrix.node-version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node v${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Static Frontend Build - node v${{ matrix.node-version }}
run: .github/workflows/frontend-build.sh
env:
DEVHUB_BACKEND_API: ${{ secrets.DEVHUB_BACKEND_API }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: dist-node-${{ matrix.node-version }}
path: frontend/dist.tar.gz
aws:
name: AWS Authentication
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Determine AWS Context
id: aws-context
run: .github/workflows/frontend-aws-context.sh
env:
DEVHUB_FRONTEND_PROD_IAM_ARN: ${{ secrets.DEVHUB_FRONTEND_PROD_IAM_ARN }}
DEVHUB_FRONTEND_RO_IAM_ARN: ${{ secrets.DEVHUB_FRONTEND_RO_IAM_ARN }}
- name: Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: us-east-1
role-to-assume: ${{ steps.aws-context.outputs.role-arn }}
role-duration-seconds: 900
- name: Download Matrix Artifacts
uses: actions/download-artifact@v3
- name: Publish Frontend
run: .github/workflows/frontend-publish.sh
env:
CF_DISTRIBUTION: ${{ secrets.DEVHUB_FRONTEND_PROD_CF_DISTRIBUTION }}
DRY_RUN: ${{ steps.aws-context.outputs.dry-run }}
S3_BUCKET: ${{ secrets.DEVHUB_FRONTEND_PROD_S3_BUCKET }}