ci(oci): switch build cache from type=registry/inline to type=gha #366
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-525-oci-gha-build-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Brings
.forgejo/workflows/build-oci-image.ymlin line with the governance GOV-20 / CI.md OCI build-cache pattern (type=gha), replacing thetype=registry+type=inlinecache it ran on the defaultdockerbuildx driver.The old shape ran a raw
docker buildx buildon the defaultdockerdriver withcache-from type=registry,ref=:latestandcache-to type=inline. Inline only carries the final layer's metadata and misses the heavy dependency-build layer, and the registry pattern round-tripped the full ~1.7 GiB buildx cache over the WAN every build and 499'd the export on slow-upload runners, so reuse never worked there (vervain-server VS-52, propagated org-wide by governance GOV-20).Changes:
Set up buildx builderstep creating adocker-containerdriver builder. Required because the defaultdockerdriver does no cache export.Export Actions runtime env for buildx gha cachestep (crazy-max/ghaction-github-runtime@v3) before the build. A rawdocker buildx builddoes not auto-inject the gha backend env andACTIONS_RUNTIME_TOKENis masked fromrun:steps, so this re-exportsACTIONS_CACHE_URL/ACTIONS_RUNTIME_TOKENintoGITHUB_ENV.cache_from = "type=gha"andcache_to = "type=gha,mode=max,ignore-error=true", passed via--cache-toon the push build (was--cache-to type=inline).Scope is the cache pattern only. The
CARGO_BUILD_JOBSnproc/2 cap (governance GOV-10) is a separate concern, not in this PR.Verification note:
type=ghaonly reaches the cache server when the runner hascache.enabled: true;ignore-error=trueswallows a disabled-cache runner silently, so confirm reuse from the build log'simporting cache manifest from gha/exporting to GitHub Actions Cachelines, not from the exit code.#PMS-525