-
Notifications
You must be signed in to change notification settings - Fork 2k
349 lines (333 loc) · 16.1 KB
/
update-docker-images.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
name: Update Docker Images
on:
schedule:
- cron: "0 1 * * 0" # run every week at 01:00 UTC on Sunday
workflow_dispatch:
inputs:
tag:
description: "Update images with tag"
required: true
dry_run:
type: boolean
default: false
defaults:
run:
shell: bash
concurrency:
group: ${{ github.ref_name }}-update
cancel-in-progress: true
permissions:
contents: read
jobs:
variables:
name: Set variables for workflow
runs-on: ubuntu-22.04
outputs:
tag: ${{ steps.kic.outputs.tag }}
short_tag: ${{ steps.kic.outputs.short }}
date: ${{ steps.kic.outputs.date }}
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Set variables
id: kic
run: |
tag="$(git tag --sort=-version:refname | head -n1)"
if [ -n "${{ inputs.tag }}" ]; then
echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
else
tag=${tag//v}
echo "tag=${tag//v}" >> $GITHUB_OUTPUT
fi
date=$(date "+%Y%m%d")
echo "date=${date}" >> $GITHUB_OUTPUT
short="${tag%.*}"
echo "short=$short" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
patch-oss-images:
name: Build OSS Images
needs: [variables]
strategy:
fail-fast: false
matrix:
include:
- tag: ${{ needs.variables.outputs.tag }}
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-ingress
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress"
platforms: "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
- tag: ${{ needs.variables.outputs.tag }}-alpine
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-alpine"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-ingress
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress"
platforms: "linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
- tag: ${{ needs.variables.outputs.tag }}-ubi
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-ingress
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress"
platforms: "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
uses: ./.github/workflows/patch-image.yml
with:
platforms: ${{ matrix.platforms }}
image: ${{ matrix.image }}
tag: ${{ matrix.tag }}
ic_version: ${{ needs.variables.outputs.tag }}
target_image: ${{ matrix.target_image }}
target_tag: ${{ matrix.target_tag }}
permissions:
contents: read
id-token: write
secrets: inherit
patch-plus-images:
name: Build Plus Images
needs: [variables]
strategy:
fail-fast: false
matrix:
include:
- tag: ${{ needs.variables.outputs.tag }}
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-plus-ingress
target_image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
platforms: "linux/arm64, linux/amd64"
- tag: ${{ needs.variables.outputs.tag }}-alpine
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-alpine"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-plus-ingress
target_image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
platforms: "linux/arm64, linux/amd64"
- tag: ${{ needs.variables.outputs.tag }}-mktpl
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-mktpl"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-plus-ingress
target_image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
platforms: "linux/arm64, linux/amd64"
- tag: ${{ needs.variables.outputs.tag }}-alpine-mktpl
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-alpine-mktpl"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-plus-ingress
target_image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
platforms: "linux/arm64, linux/amd64"
- tag: ${{ needs.variables.outputs.tag }}-ubi
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi"
image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-plus-ingress
target_image: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
platforms: "linux/arm64, linux/amd64, linux/s390x"
uses: ./.github/workflows/patch-image.yml
with:
platforms: ${{ matrix.platforms }}
image: ${{ matrix.image }}
tag: ${{ matrix.tag }}
ic_version: ${{ needs.variables.outputs.tag }}
target_image: ${{ matrix.target_image }}
target_tag: ${{ matrix.target_tag }}
permissions:
contents: read
id-token: write
secrets: inherit
patch-plus-nap-images:
name: Build Plus NAP Images
needs: [variables]
strategy:
fail-fast: false
matrix:
include:
- tag: "${{ needs.variables.outputs.tag }}"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-ubi"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-mktpl"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-mktpl"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-ubi-mktpl"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi-mktpl"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-nap-v5/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-ubi"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-nap-v5/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-ubi"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-ubi-mktpl"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi-mktpl"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-mktpl"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-mktpl"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-ubi"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-ubi-mktpl"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-ubi-mktpl"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress"
platforms: "linux/amd64"
- tag: "${{ needs.variables.outputs.tag }}-mktpl"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}-mktpl"
image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic-dos-nap/nginx-plus-ingress"
target_image: "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress"
platforms: "linux/amd64"
uses: ./.github/workflows/patch-image.yml
with:
platforms: ${{ matrix.platforms }}
image: ${{ matrix.image }}
tag: ${{ matrix.tag }}
ic_version: ${{ needs.variables.outputs.tag }}
target_image: ${{ matrix.target_image }}
target_tag: ${{ matrix.target_tag }}
permissions:
contents: read
id-token: write
secrets: inherit
release-oss-internal:
name: "Publish Docker OSS ${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }} to internal release Registries"
needs: [variables, patch-oss-images]
uses: ./.github/workflows/oss-release.yml
with:
gcr_release_registry: true
ecr_public_registry: false
dockerhub_public_registry: false
quay_public_registry: false
github_public_registry: false
source_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
dry_run: ${{ inputs.dry_run || false }}
permissions:
contents: read
id-token: write
packages: write
secrets: inherit
release-oss-public:
name: Publish Docker OSS ${{ needs.variables.outputs.tag }} to Public Registries
needs: [variables, patch-oss-images]
strategy:
fail-fast: false
matrix:
tag:
- "${{ needs.variables.outputs.tag }}"
- "${{ needs.variables.outputs.short_tag }}"
- "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
- "latest"
uses: ./.github/workflows/oss-release.yml
with:
gcr_release_registry: false
ecr_public_registry: true
dockerhub_public_registry: true
quay_public_registry: true
github_public_registry: true
source_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
target_tag: ${{ matrix.tag }}
dry_run: ${{ inputs.dry_run || false }}
permissions:
contents: read
id-token: write
packages: write
secrets: inherit
release-plus-nginx-gcr:
name: Publish Docker Plus ${{ needs.variables.outputs.tag }} to NGINX & GCR Marketplace registries
needs: [variables, patch-plus-images, patch-plus-nap-images]
strategy:
fail-fast: false
matrix:
tag:
- "${{ needs.variables.outputs.tag }}"
- "${{ needs.variables.outputs.short_tag }}"
- "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
- "latest"
uses: ./.github/workflows/plus-release.yml
with:
nginx_registry: true
gcr_release_registry: false
gcr_mktpl_registry: true
ecr_mktpl_registry: false
az_mktpl_registry: false
source_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
target_tag: ${{ matrix.tag }}
dry_run: ${{ inputs.dry_run || false }}
permissions:
contents: read
id-token: write
secrets: inherit
release-plus-azure-ecr-marketplace:
name: Publish Docker Plus ${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }} to Azure & ECR Marketplace registries
needs: [variables, patch-plus-images, patch-plus-nap-images]
uses: ./.github/workflows/plus-release.yml
with:
nginx_registry: false
gcr_release_registry: false
gcr_mktpl_registry: false
ecr_mktpl_registry: true
az_mktpl_registry: true
source_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
dry_run: ${{ inputs.dry_run || false }}
permissions:
contents: read
id-token: write
secrets: inherit
release-plus-internal:
name: Publish Docker Plus ${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }} to internal release Registries
needs: [variables, patch-plus-images, patch-plus-nap-images]
uses: ./.github/workflows/plus-release.yml
with:
nginx_registry: false
gcr_release_registry: true
gcr_mktpl_registry: false
ecr_mktpl_registry: false
az_mktpl_registry: false
source_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
target_tag: "${{ needs.variables.outputs.tag }}-${{ needs.variables.outputs.date }}"
dry_run: ${{ inputs.dry_run || false }}
permissions:
contents: read
id-token: write
secrets: inherit
certify-openshift-images:
name: Certify OpenShift UBI images
runs-on: ubuntu-22.04
needs: [variables, release-oss-public]
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Certify UBI OSS images in quay
uses: ./.github/actions/certify-openshift-image
with:
image: quay.io/nginx/nginx-ingress:${{ needs.variables.outputs.tag }}-ubi
project_id: ${{ secrets.CERTIFICATION_PROJECT_ID }}
pyxis_token: ${{ secrets.PYXIS_API_TOKEN }}
platforms: ""
if: ${{ ! inputs.dry_run || false }}