From 59a6ed2c2179110ded7616d6a882edc4361c159f Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 27 Sep 2022 16:53:59 +1000 Subject: [PATCH] doc(ci): Fix incorrect docs about Docker build cache order (#5190) * Use branch then main build caches * Revert cache order to try branch cache first Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .github/workflows/build-docker-image.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 98a394ab..d2471e9b 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -139,8 +139,11 @@ jobs: # To improve build speeds, for each branch we push an additional image to the registry, # to be used as the caching layer, using the `max` caching mode. # - # We use multiple cache sources to confirm a cache hit, starting from the `main` branch cache, - # and if there's no hit, then continue with a cache scoped per branch. + # We use multiple cache sources to confirm a cache hit, starting from a per-branch cache, + # and if there's no hit, then continue with the `main` branch. Changes within a PR are usually + # small, so this provides the best performance. + # + # The last cache in the list is tried first. cache-from: | type=registry,ref=us-docker.pkg.dev/zealous-zebra/zebra/${{ inputs.image_name }}:main-cache type=registry,ref=us-docker.pkg.dev/zealous-zebra/zebra/${{ inputs.image_name }}:${{ env.GITHUB_REF_SLUG_URL }}-cache