ci(docker): move BuildKit layer cache from GHA to GHCR registry
Merged
GR
9d ago+32+32+01234567890123456789-7-7-0123456789
Summary
Part 1 of the CI optimization series (from the 150-run audit).
Currently the repo's 10 GB GitHub Actions cache quota is 100% full (10.4 GB / 10.0 GB):
docker.ymlbuildkit-blob-*entries consume ~8.7 GB (4.1 GB + 3.0 GB + 1.1 GB + 0.5 GB)- CodeQL overlay databases consume ~1.4 GB
Because GHA cache is saturated, enabling sccache, uv, or ROCm SDK caching in ci.yml would cause immediate cache eviction.
Changes
- Derive a lowercase GHCR buildcache ref (
ghcr.io/<owner>/lucebox-hub:buildcache-<variant>) inCapture build identity. - Switch
docker/bake-actionfromtype=ghatotype=registry:cache-fromreads the public GHCR buildcache image on all events (including fork PRs, no write permissions needed).cache-towritesmode=maxcache layers only onmain/release/workflow_dispatchwithpush=true(where GHCR login already runs).
Expected Impact
- Reclaims ~8.7 GB of the 10 GB GitHub Actions cache quota for
ci.ymlcompiler (sccache) and dependency caches. - GHCR registry caching is unlimited for public repositories.
- Follow-up after merge: delete stale
buildkit-blob-*GHA cache entries once to immediately free quota.