-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (70 loc) · 2.3 KB
/
ci.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
80
81
82
83
84
85
86
87
name: Staking Portal CI
on: [push, workflow_dispatch]
jobs:
documentation:
name: Attach Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'false'
- name: Attach Documentation
run: cat .github/workflows/ci.md >> $GITHUB_STEP_SUMMARY
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
name: Build rex-staking-portal - 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: Init - node v${{ matrix.node-version }}
run: yarn --frozen-lockfile --non-interactive
- name: Lint - node v${{ matrix.node-version }}
run: yarn check
- name: Static Build - node v${{ matrix.node-version }}
run: .github/workflows/build.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: dist-node-${{ matrix.node-version }}
path: dist.tar.gz
aws:
name: Publish rex-staking-portal
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/aws-context.sh
env:
STAKING_PROD_IAM_ARN: ${{ secrets.STAKING_PROD_IAM_ARN }}
STAKING_RO_IAM_ARN: ${{ secrets.STAKING_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 Website
run: .github/workflows/publish.sh
env:
CF_DISTRIBUTION: ${{ secrets.STAKING_PROD_CF_DISTRIBUTION }}
DRY_RUN: ${{ steps.aws-context.outputs.dry-run }}
S3_BUCKET: ${{ secrets.STAKING_PROD_S3_BUCKET }}