46
46
ic_version : ${{ steps.vars.outputs.ic_version }}
47
47
publish_images : ${{ steps.vars.outputs.publish }}
48
48
docker_md5 : ${{ steps.vars.outputs.docker_md5 }}
49
+ build_tag : ${{ steps.vars.outputs.build_tag }}
50
+ stable_tag : ${{ steps.vars.outputs.stable_tag }}
49
51
forked_workflow : ${{ (github.event.pull_request.head.repo.full_name != github.repository) && ! (startsWith(github.ref, 'refs/heads/release-') || github.ref_name == 'main') }}
50
52
steps :
51
53
- name : Checkout Repository
96
98
echo "publish=$publish" >> $GITHUB_OUTPUT
97
99
./.github/scripts/variables.sh go_code_md5 >> $GITHUB_OUTPUT
98
100
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
101
+ ./.github/scripts/variables.sh build_tag >> $GITHUB_OUTPUT
102
+ ./.github/scripts/variables.sh stable_tag >> $GITHUB_OUTPUT
99
103
cat $GITHUB_OUTPUT
100
104
101
105
- name : Fetch Cached Binary Artifacts
@@ -235,16 +239,20 @@ jobs:
235
239
if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
236
240
237
241
helm-tests :
238
- name : Helm Tests
242
+ name : Helm Tests ${{ matrix.base-os }}
239
243
runs-on : ubuntu-22.04
240
244
needs : [checks, binaries]
241
245
strategy :
242
246
matrix :
243
247
include :
244
- - image : debian
248
+ - base-os : debian
249
+ image : gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress
250
+ tag : ${{ needs.checks.outputs.build_tag }}
245
251
type : oss
246
252
platforms : " linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
247
- - image : debian-plus
253
+ - base-os : debian-plus
254
+ image : gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
255
+ tag : ${{ needs.checks.outputs.build_tag }}
248
256
type : plus
249
257
platforms : " linux/arm64, linux/amd64"
250
258
permissions :
@@ -289,7 +297,7 @@ jobs:
289
297
- name : Check if base images exist
290
298
id : base_exists
291
299
run : |
292
- if docker manifest inspect gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/${{ matrix.type }}:${{ needs.checks.outputs.docker_md5 }}-${{ matrix.image }}; then
300
+ if docker manifest inspect gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/${{ matrix.type }}:${{ needs.checks.outputs.docker_md5 }}-${{ matrix.base-os }}; then
293
301
echo "exists=0" >> $GITHUB_OUTPUT
294
302
else
295
303
echo "exists=1" >> $GITHUB_OUTPUT
@@ -301,34 +309,34 @@ jobs:
301
309
with :
302
310
file : build/Dockerfile
303
311
context : " ."
304
- cache-from : type=gha,scope=${{ matrix.image }}
305
- cache-to : type=gha,scope=${{ matrix.image }},mode=max
312
+ cache-from : type=gha,scope=${{ matrix.base-os }}
313
+ cache-to : type=gha,scope=${{ matrix.base-os }},mode=max
306
314
target : common
307
- tags : gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/${{ matrix.type }}:${{ needs.checks.outputs.docker_md5 }}-${{ matrix.image }}
315
+ tags : gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/${{ matrix.type }}:${{ needs.checks.outputs.docker_md5 }}-${{ matrix.base-os }}
308
316
platforms : ${{ matrix.platforms }}
309
317
pull : true
310
318
push : true
311
319
build-args : |
312
- BUILD_OS=${{ matrix.image }}
320
+ BUILD_OS=${{ matrix.base-os }}
313
321
IC_VERSION=${{ needs.checks.outputs.ic_version }}
314
322
secrets : |
315
323
${{ matrix.type == 'plus' && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
316
324
${{ matrix.type == 'plus' && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}
317
325
if : ${{ needs.checks.outputs.forked_workflow == 'false' && steps.base_exists.outputs.exists != 0 }}
318
326
319
- - name : Build Docker Image ${{ matrix.image }}
327
+ - name : Build Docker Image ${{ matrix.base-os }}
320
328
uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
321
329
with :
322
330
file : build/Dockerfile
323
331
context : " ."
324
- cache-from : type=gha,scope=${{ matrix.image }}
332
+ cache-from : type=gha,scope=${{ matrix.base-os }}
325
333
target : goreleaser${{ needs.checks.outputs.forked_workflow == 'false' && '-prebuilt' || '' }}
326
- tags : ${{ matrix.type }}:${{ github.sha }}
334
+ tags : " ${{ matrix.image }}:${{ matrix.tag }}"
327
335
pull : true
328
336
load : true
329
337
build-args : |
330
- BUILD_OS=${{ matrix.image }}
331
- PREBUILT_BASE_IMG=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/${{ matrix.type }}:${{ needs.checks.outputs.docker_md5 }}-${{ matrix.image }}
338
+ BUILD_OS=${{ matrix.base-os }}
339
+ PREBUILT_BASE_IMG=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/${{ matrix.type }}:${{ needs.checks.outputs.docker_md5 }}-${{ matrix.base-os }}
332
340
IC_VERSION=CI
333
341
secrets : |
334
342
${{ matrix.type == 'plus' && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
@@ -338,15 +346,15 @@ jobs:
338
346
id : k8s
339
347
run : |
340
348
kind create cluster --name ${{ github.run_id }} --image=kindest/node:v${{ needs.checks.outputs.k8s_latest }} --wait 75s
341
- kind load docker-image ${{ matrix.type }}:${{ github.sha }} --name ${{ github.run_id }}
349
+ kind load docker-image ${{ matrix.image }}:${{ matrix.tag }} --name ${{ github.run_id }}
342
350
343
351
- name : Install Chart
344
352
run : >
345
353
helm install
346
354
${{ matrix.type }}
347
355
.
348
- --set controller.image.repository=${{ matrix.type }}
349
- --set controller.image.tag=${{ github.sha }}
356
+ --set controller.image.repository=${{ matrix.image }}
357
+ --set controller.image.tag=${{ matrix.tag }}
350
358
--set controller.service.type=NodePort
351
359
--set controller.nginxplus=${{ contains(matrix.type, 'plus') && 'true' || 'false' }}
352
360
--wait
@@ -453,6 +461,13 @@ jobs:
453
461
- name : Checkout Repository
454
462
uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
455
463
464
+ - name : Set image variables
465
+ id : image_details
466
+ run : |
467
+ echo "name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic${{ contains(matrix.images.nap_modules, 'dos') && '-dos' || '' }}${{ contains(matrix.images.nap_modules, 'waf') && '-nap' || '' }}/nginx${{ contains(matrix.images.image, 'plus') && '-plus' || '' }}-ingress" >> $GITHUB_OUTPUT
468
+ echo "build_tag=${{ needs.checks.outputs.build_tag }}${{ contains(matrix.images.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.images.image, 'alpine') && '-alpine' || '' }}${{ contains(matrix.images.target, 'aws') && '-mktpl' || '' }}${{ contains(matrix.images.image, 'fips') && '-fips' || ''}}" >> $GITHUB_OUTPUT
469
+ echo "stable_tag=${{ needs.checks.outputs.stable_tag }}${{ contains(matrix.images.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.images.image, 'alpine') && '-alpine' || '' }}${{ contains(matrix.images.target, 'aws') && '-mktpl' || '' }}${{ contains(matrix.images.image, 'fips') && '-fips' || ''}}" >> $GITHUB_OUTPUT
470
+
456
471
- name : NAP modules
457
472
id : nap_modules
458
473
run : |
@@ -553,7 +568,7 @@ jobs:
553
568
cache-from : type=gha,scope=${{ matrix.images.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}
554
569
cache-to : type=gha,scope=${{ matrix.images.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }},mode=max
555
570
target : goreleaser${{ needs.checks.outputs.forked_workflow == 'false' && '-prebuilt' || '' }}
556
- tags : " docker.io/nginx/nginx ${{ contains(matrix.images.image, 'plus') && '-plus' || '' }}-ingress :${{ matrix.images.image }}${{ contains(matrix.images.marker, 'dos') && '-dos' || '' }}${{ contains(matrix.images.marker, 'appprotect') && '-nap' || '' }}-${{ github.sha }}"
571
+ tags : " ${{ steps.image_details.outputs.name }} :${{ steps.image_details.outputs.build_tag }}"
557
572
load : true
558
573
pull : true
559
574
build-args : |
@@ -572,8 +587,8 @@ jobs:
572
587
uses : ./.github/actions/smoke-tests
573
588
with :
574
589
image-type : ${{ matrix.images.image }}
575
- image-name : docker.io/nginx/nginx ${{ contains(matrix.images.image, 'plus') && '-plus' || '' }}-ingress
576
- tag : ${{ matrix.images.image }}${{ contains(matrix.images.marker, 'dos') && '-dos' || '' }}${{ contains(matrix.images.marker, 'appprotect') && '-nap' || '' }}-${{ github.sha }}
590
+ image-name : ${{ steps.image_details.outputs.name }}
591
+ tag : ${{ steps.image_details.outputs.build_tag }}
577
592
marker : ${{ matrix.images.marker != '' && matrix.images.marker || '' }}
578
593
k8s-version : ${{ matrix.k8s }}
579
594
azure-ad-secret : ${{ secrets.AZURE_AD_AUTOMATION }}
0 commit comments