-
Notifications
You must be signed in to change notification settings - Fork 18
97 lines (91 loc) · 2.63 KB
/
mainnet-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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Frontend CI
on:
pull_request:
branches:
- develop
types:
- closed
permissions:
id-token: write
contents: read
env:
ENVIRONMENT: mainnet
jobs:
codecov:
if: github.event.pull_request.merged == true
runs-on: powerfulubuntu
steps:
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
get-diff:
if: github.event.pull_request.merged == true
runs-on: powerfulubuntu
environment: mainnet
outputs:
file_exists: ${{ steps.deployment_list.outputs.exist }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
lfs: true
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-southeast-2
role-to-assume: ${{ secrets.FLU_AWS_GITHUB_OIDC_ROLE }}
role-duration-seconds: 7200 #seconds
- name: Get Diff
id: diff
uses: ./scripts/actions
with:
command: |
flu get-diff --environment $ENVIRONMENT --tag $GITHUB_SHA
- uses: actions/upload-artifact@v3
with:
name: diff-artifact
path: ./deployment_list.json
- name: Check if deployment data exist
id: deployment_list
run: |
if [[ -f "./deployment_list.json" ]]; then
echo "exist=true" >> $GITHUB_OUTPUT
fi
deploy-web:
if: needs.get-diff.outputs.file_exists == 'true'
runs-on: powerfulubuntu
environment: mainnet
needs: [get-diff]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
lfs: true
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-southeast-2
role-to-assume: ${{ secrets.FLU_AWS_GITHUB_OIDC_ROLE }}
role-duration-seconds: 7200 #seconds
- uses: actions/download-artifact@v3
with:
name: diff-artifact
- name: Build
id: build
uses: ./scripts/actions
with:
command: |
flu build-diff --network fluidity --environment $ENVIRONMENT --tag $GITHUB_SHA
- name: Deploy
id: deploy
uses: ./scripts/actions
with:
command: |
flu deploy-diff --network fluidity --environment $ENVIRONMENT --tag $GITHUB_SHA
- name: Discord
uses: ./scripts/actions
if: always()
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
with:
command: |
flu send-discord --webhook-url ${{ secrets.FLU_CI_DISCORD_WEBHOOK_URL }} --status ${{ job.status }}