-
Notifications
You must be signed in to change notification settings - Fork 34
295 lines (281 loc) · 11.4 KB
/
Copy pathbuild-push-nimbus-eth2.yml
File metadata and controls
295 lines (281 loc) · 11.4 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Build nimbus-eth2 docker image
run-name: "${{ inputs.repository }}@${{ inputs.ref }}${{ inputs.correlation_id && format(' [{0}]', inputs.correlation_id) || '' }}"
on:
workflow_dispatch:
inputs:
repository:
description: The source nimbus-eth2 repository to build from
default: status-im/nimbus-eth2
type: string
required: true
ref:
description: The branch, tag or SHA to checkout and build from
default: unstable
type: string
required: true
docker_tag:
description: Override target docker tag (defaults to the above source ref if left blank)
type: string
required: false
correlation_id:
description: Optional correlation ID passed through to the run name (used by integrations)
type: string
required: false
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
platforms: ${{ steps.setup.outputs.platforms }}
target_tag: ${{ steps.tag.outputs.docker_tag }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Prepare Matrix
id: setup
uses: ./.github/actions/prepare
with:
client: 'nimbus-eth2'
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
- name: Generate target tag
id: tag
uses: ./.github/actions/docker-tag
with:
input: ${{ inputs.docker_tag || inputs.ref }}
repository: ${{ inputs.repository }}
upstream_repository: status-im/nimbus-eth2
docker_tag: ${{ inputs.docker_tag }}
deploy-beacon:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
outputs:
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/install-deps
with:
repository: ${{ inputs.repository }}
- uses: ./.github/actions/deploy
id: deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
target_repository: ethpandaops/nimbus-eth2
target_dockerfile: ./nimbus-eth2/Dockerfile.beacon
platform: ${{ matrix.platform }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
# This step captures the git commit hash from the deploy action for job output
- name: Set job output
id: set_output
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
shell: bash
deploy-beacon-minimal:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
outputs:
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/install-deps
with:
repository: ${{ inputs.repository }}
- uses: ./.github/actions/deploy
id: deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal-${{ matrix.slug }}
target_repository: ethpandaops/nimbus-eth2
target_dockerfile: ./nimbus-eth2/Dockerfile.beacon-minimal
platform: ${{ matrix.platform }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
# This step captures the git commit hash from the deploy action for job output
- name: Set job output
id: set_output
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
shell: bash
deploy-validator:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
outputs:
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/deploy
id: deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
target_repository: ethpandaops/nimbus-validator-client
target_dockerfile: ./nimbus-eth2/Dockerfile.validator
platform: ${{ matrix.platform }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
# This step captures the git commit hash from the deploy action for job output
- name: Set job output
id: set_output
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
shell: bash
deploy-validator-minimal:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.platforms)}}
outputs:
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/deploy
id: deploy
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal-${{ matrix.slug }}
target_repository: ethpandaops/nimbus-validator-client
target_dockerfile: ./nimbus-eth2/Dockerfile.validator-minimal
platform: ${{ matrix.platform }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
GOPROXY: "${{ vars.GOPROXY }}"
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
# This step captures the git commit hash from the deploy action for job output
- name: Set job output
id: set_output
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
shell: bash
manifest-beacon:
needs:
- prepare
- deploy-beacon
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}
target_repository: ethpandaops/nimbus-eth2
platforms: ${{ needs.prepare.outputs.platforms }}
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
git_commit_hash: ${{ needs.deploy-beacon.outputs.git_commit_hash }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
manifest-beacon-minimal:
needs:
- prepare
- deploy-beacon-minimal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal
target_repository: ethpandaops/nimbus-eth2
platforms: ${{ needs.prepare.outputs.platforms }}
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
git_commit_hash: ${{ needs.deploy-beacon-minimal.outputs.git_commit_hash }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
manifest-validator:
needs:
- prepare
- deploy-validator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}
target_repository: ethpandaops/nimbus-validator-client
platforms: ${{ needs.prepare.outputs.platforms }}
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
git_commit_hash: ${{ needs.deploy-validator.outputs.git_commit_hash }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
manifest-validator-minimal:
needs:
- prepare
- deploy-validator-minimal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/manifest
with:
source_repository: ${{ inputs.repository }}
source_ref: ${{ inputs.ref }}
target_tag: ${{ needs.prepare.outputs.target_tag }}-minimal
target_repository: ethpandaops/nimbus-validator-client
platforms: ${{ needs.prepare.outputs.platforms }}
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
git_commit_hash: ${{ needs.deploy-validator-minimal.outputs.git_commit_hash }}
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
notify:
name: Discord Notification
runs-on: ubuntu-latest
needs:
- prepare
- deploy-beacon
- deploy-beacon-minimal
- deploy-validator
- deploy-validator-minimal
- manifest-beacon
- manifest-beacon-minimal
- manifest-validator
- manifest-validator-minimal
if: failure()
steps:
- name: Notify
uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1
with:
github-token: ${{ secrets.github_token }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}