-
-
Notifications
You must be signed in to change notification settings - Fork 63
351 lines (325 loc) · 13.2 KB
/
action_pull_request.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
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: build
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
pull_request:
jobs:
# -----------------------------------------------------------------------------------------------
# (1/4) Determine parameter settings
# -----------------------------------------------------------------------------------------------
params:
uses: ./.github/workflows/params.yml
# Only run for forks (contributor)
if: github.event.pull_request.head.repo.fork
# -----------------------------------------------------------------------------------------------
# (2/4) Configure Build and Deploy Matrices
# -----------------------------------------------------------------------------------------------
configure:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master
with:
enabled: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && (github.event.pull_request.user.login != 'cytopia')) }}
can_deploy: false
versions: ${{ needs.params.outputs.versions }}
refs: ${{ needs.params.outputs.refs }}
secrets:
dockerhub_username: ""
dockerhub_password: ""
configure-awskops:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master
with:
enabled: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && (github.event.pull_request.user.login != 'cytopia')) }}
can_deploy: false
versions: ${{ needs.params.outputs.versions }}
refs: ${{ needs.params.outputs.refs }}
fields_build: '[{"VERSION":"VERSION"}, {"FLAVOUR":"FLAVOUR"}, {"KOPS":"EXTRA"}, {"ARCH":"ARCH"}]'
fields_deploy: '[{"VERSION":"VERSION"}, {"FLAVOUR":"FLAVOUR"}, {"KOPS":"EXTRA"}]'
secrets:
dockerhub_username: ""
dockerhub_password: ""
configure-awshelm:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master
with:
enabled: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && (github.event.pull_request.user.login != 'cytopia')) }}
can_deploy: false
versions: ${{ needs.params.outputs.versions }}
refs: ${{ needs.params.outputs.refs }}
fields_build: '[{"VERSION":"VERSION"}, {"FLAVOUR":"FLAVOUR"}, {"HELM":"EXTRA"}, {"ARCH":"ARCH"}]'
fields_deploy: '[{"VERSION":"VERSION"}, {"FLAVOUR":"FLAVOUR"}, {"HELM":"EXTRA"}]'
secrets:
dockerhub_username: ""
dockerhub_password: ""
# -----------------------------------------------------------------------------------------------
# (3/4) Build & Test
# -----------------------------------------------------------------------------------------------
build-base:
needs:
- configure
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: true
push_image: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure.outputs.matrix_build }}
stage: base
stage_prev: ''
secrets:
dockerhub_username: ""
dockerhub_password: ""
build-tools:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: false
push_image: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure.outputs.matrix_build }}
stage: tools
stage_prev: base
secrets:
dockerhub_username: ""
dockerhub_password: ""
build-aws:
needs:
- configure
- build-tools
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: false
push_image: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure.outputs.matrix_build }}
stage: aws
stage_prev: tools
secrets:
dockerhub_username: ""
dockerhub_password: ""
build-azure:
needs:
- configure
- build-tools
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: false
push_image: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure.outputs.matrix_build }}
stage: azure
stage_prev: tools
secrets:
dockerhub_username: ""
dockerhub_password: ""
build-infra:
needs:
- configure
- build-tools
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: false
push_image: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure.outputs.matrix_build }}
stage: infra
stage_prev: tools
secrets:
dockerhub_username: ""
dockerhub_password: ""
build-awsk8s:
needs:
- configure
- build-aws
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: false
push_image: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure.outputs.matrix_build }}
stage: awsk8s
stage_prev: aws
secrets:
dockerhub_username: ""
dockerhub_password: ""
# Note: awskops is special
build-awskops:
needs:
- configure-awskops
- build-awsk8s
uses: ./.github/workflows/docker-multistage-build-extra.yml
with:
has_refs: ${{ needs.configure-awskops.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure-awskops.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: false
push_image: ${{ needs.configure-awskops.outputs.can_login == 'true' && needs.configure-awskops.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure-awskops.outputs.matrix_build }}
stage: awskops
stage_prev: awsk8s
extra_make_var_name: KOPS
secrets:
dockerhub_username: ""
dockerhub_password: ""
# Note: awshelm is special
build-awshelm:
needs:
- configure-awshelm
- build-awsk8s
uses: ./.github/workflows/docker-multistage-build-extra.yml
with:
has_refs: ${{ needs.configure-awshelm.outputs.has_refs == 'true' }}
artifact_prefix: ${{ needs.configure-awshelm.outputs.artifact_prefix }}
upload_artifact: true
pull_base_image: false
push_image: ${{ needs.configure-awshelm.outputs.can_login == 'true' && needs.configure-awshelm.outputs.can_push == 'true' }}
run_tests: true
matrix: ${{ needs.configure-awshelm.outputs.matrix_build }}
stage: awshelm
stage_prev: awsk8s
extra_make_var_name: HELM
secrets:
dockerhub_username: ""
dockerhub_password: ""
# -----------------------------------------------------------------------------------------------
# (4/4) Push Manifests
# -----------------------------------------------------------------------------------------------
manifest-base:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: base
secrets:
dockerhub_username: ""
dockerhub_password: ""
manifest-tools:
needs:
- configure
- build-tools
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: tools
secrets:
dockerhub_username: ""
dockerhub_password: ""
manifest-infra:
needs:
- configure
- build-infra
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: infra
secrets:
dockerhub_username: ""
dockerhub_password: ""
manifest-azure:
needs:
- configure
- build-azure
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: azure
secrets:
dockerhub_username: ""
dockerhub_password: ""
manifest-aws:
needs:
- configure
- build-aws
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: aws
secrets:
dockerhub_username: ""
dockerhub_password: ""
manifest-awsk8s:
needs:
- configure
- build-awsk8s
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: awsk8s
secrets:
dockerhub_username: ""
dockerhub_password: ""
# Note: awskops is special
manifest-awskops:
needs:
- configure-awskops
- build-awskops
uses: ./.github/workflows/docker-multistage-push-manifest-kops.yml
with:
can_deploy: ${{ needs.configure-awskops.outputs.can_login == 'true' && needs.configure-awskops.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure-awskops.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure-awskops.outputs.matrix_deploy }}
versions: ${{ needs.configure-awskops.outputs.versions }}
stage: awskops
secrets:
dockerhub_username: ""
dockerhub_password: ""
# Note: awshelm is special
manifest-awshelm:
needs:
- configure-awshelm
- build-awshelm
uses: ./.github/workflows/docker-multistage-push-manifest-helm.yml
with:
can_deploy: ${{ needs.configure-awshelm.outputs.can_login == 'true' && needs.configure-awshelm.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure-awshelm.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure-awshelm.outputs.matrix_deploy }}
versions: ${{ needs.configure-awshelm.outputs.versions }}
stage: awshelm
secrets:
dockerhub_username: ""
dockerhub_password: ""