-
Notifications
You must be signed in to change notification settings - Fork 7
183 lines (169 loc) · 6.84 KB
/
deploy.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: deploy
on:
push:
branches: [release]
tags: ['v*']
permissions:
id-token: write
contents: read
jobs:
dependencies:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set up Node.js 20.x
# https://github.com/actions/setup-node/releases/tag/v4.0.3
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: 20.x
- name: Cache node modules
# https://github.com/actions/cache/releases/tag/v4.0.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: /home/runner/work/hathor-explorer/hathor-explorer/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: |
npm install
tar -cvf node_modules.tar ./node_modules
- name: Upload node modules
# https://github.com/actions/upload-artifact/releases/tag/v4.3.4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
with:
name: node_modules
path: node_modules.tar
if-no-files-found: error
retention-days: 1
deploy-testnet-explorer:
if: github.ref == 'refs/heads/release'
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::769498303037:role/ExplorerGitHubActionsRoleTestnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules
- name: Build
run: |
tar -xf node_modules.tar
make build site=testnet
- name: Deploy Testnet Explorer
run: |
make deploy site=testnet
deploy-nano-testnet-explorer:
if: github.ref == 'refs/heads/release'
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::471112952246:role/ExplorerGitHubActionsRole
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules
- name: Build
run: |
tar -xf node_modules.tar
make build site=nano-testnet
- name: Deploy Nano Testnet Explorer
run: |
make deploy site=nano-testnet
deploy-ekvilibro-testnet-explorer:
if: github.ref == 'refs/heads/release'
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::730335348496:role/ExplorerGitHubActionsRoleEkvilibroTestnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules
- name: Build
run: |
tar -xf node_modules.tar
make build site=ekvilibro-testnet
- name: Deploy Ekvilibro Testnet Explorer
run: |
make deploy site=ekvilibro-testnet
deploy-ekvilibro-mainnet-explorer:
if: startsWith(github.ref, 'refs/tags/v')
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::730335348496:role/ExplorerGitHubActionsRoleEkvilibroMainnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules
- name: Build
run: |
tar -xf node_modules.tar
make build site=ekvilibro-mainnet
- name: Deploy Ekvilibro Mainnet Explorer
run: |
make deploy site=ekvilibro-mainnet
deploy-mainnet-explorer:
if: startsWith(github.ref, 'refs/tags/v')
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::769498303037:role/ExplorerGitHubActionsRoleMainnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules
- name: Build
run: |
tar -xf node_modules.tar
make build site=mainnet
- name: Deploy Mainnet Explorer
run: |
make deploy site=mainnet