imp(ci): do not invalidate cache between PRs (#3996)

When a PR is created and an image is built in a branch, the cache is also pushed to a `buildcache` tag.

As all PRs are using the same tag, sometimes the cache for a specific branch gets invalidated and makes it take longer on further pushes.

This fix might make the first commit take longer, but further ones will be faster if no changes in the code are applied.
This commit is contained in:
Gustavo Valverde 2022-03-30 21:34:12 -04:00 committed by GitHub
parent 88f4d1841f
commit 75ae05b257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -125,8 +125,8 @@ jobs:
RUST_LOG=debug
SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }}
push: true
cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:${{ env.GITHUB_REF_SLUG_URL }}-buildcache
cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:${{ env.GITHUB_REF_SLUG_URL }}-buildcache,mode=max
# Test that Zebra can run a full mainnet sync after a PR is approved
test-full-sync:

View File

@ -126,8 +126,8 @@ jobs:
RUST_LOG=debug
SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }}
push: true
cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:${{ env.GITHUB_REF_SLUG_URL }}-buildcache
cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:${{ env.GITHUB_REF_SLUG_URL }}-buildcache,mode=max
# Run all the zebra tests, including tests that are ignored by default
test-all: