Log the cli job in to the registry before it writes a build cache

7f577c4 · Gabriel Morell · 2026-09-19 03:28

3 files +11 -1
Message
{commit_body(@commit)}

Files changed

modified .forgejo/workflows/build.yml
+11 −1
@@ -301,6 +301,16 @@ jobs:
301 301
302 302 - uses: docker/setup-buildx-action@v3
303 303
304 + # `--cache-to` writes to the registry, which needs the same
305 + # per-job credentials `build` uses to push its image. Without
306 + # this the packages build and the run then fails at the very end
307 + # on a 401 exporting the cache.
308 + - uses: docker/login-action@v3
309 + with:
310 + registry: ${{ vars.CI_REGISTRY }}
311 + username: gitgud-actions
312 + password: ${{ github.token }}
313 +
304 314 - name: Resolve the forge URL
305 315 env:
306 316 CI_FORGE_URL: ${{ vars.CI_FORGE_URL }}
@@ -351,7 +361,7 @@ jobs:
351 361 --build-arg SOURCE_DATE_EPOCH="$epoch" \
352 362 --build-arg SUITES="$SUITES" \
353 363 --cache-from type=registry,ref=${{ vars.CI_REGISTRY }}/${{ github.repository }}:cli-buildcache \
354 − --cache-to type=registry,ref=${{ vars.CI_REGISTRY }}/${{ github.repository }}:cli-buildcache,mode=max \
364 + --cache-to type=registry,ref=${{ vars.CI_REGISTRY }}/${{ github.repository }}:cli-buildcache,mode=max,ignore-error=true \
355 365 --output type=local,dest=./cli-dist \
356 366 --file cli/Dockerfile .
357 367

Parents: 56749c0