Skip to content

Commit e61e38a

Browse files
authored
Use download artifact instead (#4033)
Problem: After the secure build workflow changes, on main or production runs the build binary job was running on a different runner type from the helm tests job meaning the cache doesn't work correctly between these stages. Additionally, the nightly run attempts to log in to the NGINX image registry using the actor of the pipeline. This has been failing as the actor of the scheduled builds no longer works here. Solution: Use artifact upload and download instead of cache for the binary so it persists across runner types, and edit the schedule line with a comment so that I appear as the actor for the nightly runs instead
1 parent 2d2dfa8 commit e61e38a

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
with:
5353
ref: ${{ (inputs.tag != '' && !inputs.dry_run ) && format('refs/tags/v{0}', inputs.tag) || github.ref }}
5454

55-
- name: Fetch Cached Artifacts
56-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
55+
- name: Download Artifacts
56+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
5757
with:
58+
name: dist-${{ github.run_id }}
5859
path: ${{ github.workspace }}/dist
59-
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
6060

6161
- name: Docker Buildx
6262
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
branches:
1010
- "**"
1111
schedule:
12-
- cron: "0 4 * * *" # run every day at 4am UTC
12+
- cron: "0 4 * * *" # run every day at 4am UTC (nightly builds)
1313
workflow_call:
1414
inputs:
1515
is_production_release:
@@ -265,11 +265,12 @@ jobs:
265265
echo "Generated JSON: $json"
266266
echo "json=$json" >> $GITHUB_OUTPUT
267267
268-
- name: Cache Artifacts
269-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
268+
- name: Upload Artifacts
269+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
270270
with:
271+
name: dist-${{ github.run_id }}
271272
path: ${{ github.workspace }}/dist
272-
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
273+
retention-days: 1
273274

274275
assertion:
275276
name: Generate and Sign Assertion Documents
@@ -307,11 +308,11 @@ jobs:
307308
with:
308309
go-version: stable
309310

310-
- name: Fetch Cached Artifacts
311-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
311+
- name: Download Artifacts
312+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
312313
with:
314+
name: dist-${{ github.run_id }}
313315
path: ${{ github.workspace }}/dist
314-
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
315316

316317
- name: List Dependencies in Go Binary
317318
id: godeps

.github/workflows/helm.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
with:
2525
fetch-depth: 0
2626

27-
- name: Fetch Cached Artifacts
28-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
27+
- name: Download Artifacts
28+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
2929
with:
30+
name: dist-${{ github.run_id }}
3031
path: ${{ github.workspace }}/dist
31-
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
3232

3333
- name: Docker Buildx
3434
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1

0 commit comments

Comments
 (0)