Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cache): use mode=max for faster builds #43

Merged
merged 7 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ jobs:
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
with:
# TODO: remove the digest pinning after changes from https://github.com/moby/buildkit/pull/2506 are published (probably after v0.9.3)
driver-opts: |
image=moby/buildkit:master@sha256:b8d8458bbab41b575614801826d3e0f50e93d8730aaf68431713e3bdb4378744
config-inline: |
[registry."docker.io"]
mirrors = ["mirror.gcr.io"]
Expand Down
2 changes: 1 addition & 1 deletion images/alpine/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const variant = (version, alpine, override = (s) => s) =>
'linux/ppc64le',
'linux/s390x',
],
cacheScope: `alpine-${alpine}`
cacheScope: `alpine-${alpine}-${version}`
})

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion images/debian/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const variant = (version, debian, override = (s) => s) =>
'linux/ppc64le',
'linux/s390x', // fails to install runtime dependencies
],
cacheScope: `debian-${debian}`
cacheScope: `debian-${debian}-${version}`
})

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion images/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const matrixEntryConverter = ({ context, file }, overrides = {}) => async (
.join('\n'),
paltforms: build.platforms.join(','),
cacheFrom: `type=gha,scope=${build.cacheScope}`,
cacheTo: `type=gha,scope=${build.cacheScope}`,
cacheTo: `type=gha,mode=max,scope=${build.cacheScope}`,
tags: build.fullTags.join('\n'),
},
}
Expand Down