Closed ro0NL closed 1 year ago
Maybe GitHub Actions cache is full so old objects are GCed? Would need to see your full workflow, Dockerfile and logs to make sure. Link to your repo would be easier though.
@crazy-max i think i'm able to reproduce:
1st run without cache: https://github.com/ro0NL/test-docker-build/actions/runs/5724005099/job/15509630853 2nd run with 45 existing cache entries: https://github.com/ro0NL/test-docker-build/actions/runs/5724018658/job/15509671146
after the 2nd run there are 94 caches
initially i did saw CACHED docker steps
after using
'on':
push:
tags:
- '*.*.*'
it seems to defacto ignore existing build cache, but keeps writing it
the same happens with local cache as per https://docs.docker.com/build/ci/github-actions/cache/#local-cache
i think it's because restore-keys
doesnt load the cache by matching prefix from a previous tag
oh well, this took too much time already
after using
'on': push: tags: - '*.*.*'
it seems to defacto ignore existing build cache, but keeps writing it
Cache is scoped in GHA, you can find out looking at "GitHub Actions runtime token ACs":
1st run without cache: https://github.com/ro0NL/test-docker-build/actions/runs/5724005099/job/15509630853
2nd run with 45 existing cache entries: https://github.com/ro0NL/test-docker-build/actions/runs/5724018658/job/15509671146
As you can see you can read cache from main branch but not between tags.
IIUC it can only work if the main branch is build on each commit?
Hi,
Im using the following job step for building a multistage dockerfile:
After the first run 53 caches are written
After the second run 105 caches are written, and no existing cache is used.
Locally the build cache works fine.
Am i missing something?