ci: add Docker layer caching via BuildKit GHA cache backend - #245
Merged
Conversation
Replace plain docker build with docker/build-push-action using cache-from/cache-to with type=gha. This caches Docker layers in GitHub Actions cache storage, cutting rebuild times from ~14-18min to near-zero on cache hits. Fixes #241
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the plain
docker buildstep withdocker/build-push-action@v6using the BuildKit GHA cache backend (cache-from: type=gha/cache-to: type=gha,mode=max).This caches Docker build layers in GitHub Actions cache storage, so subsequent CI runs skip already-built layers. Combined with the cargo-chef setup in the Containerfile, dependency compilation layers should be cached across runs — cutting the ~14-18min Docker build down to near-zero on cache hits.
Changes:
docker/setup-buildx-action@v3stepdocker buildshell step withdocker/build-push-action@v6with GHA cacheload: truemakes the image available locally for any downstream stepsFixes #241