From bbe9f90b92c8b0966dc4d90e0530ee9f24cc0d16 Mon Sep 17 00:00:00 2001 From: Luca Osti Date: Tue, 6 Aug 2024 09:43:41 +0200 Subject: [PATCH 1/3] Use refname for cache key Instead of the full ref (so it actually matches with the `-main` fallback) --- .github/workflows/deploy-production.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index a52014f66d..b7e2af6207 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -50,7 +50,7 @@ jobs: id: gatsby-cache-folder with: path: .cache - key: ${{ runner.os }}-cache-gatsby-${{ github.ref }} + key: ${{ runner.os }}-cache-gatsby-${{ github.refname }} restore-keys: | ${{ runner.os }}-cache-gatsby-main @@ -59,7 +59,7 @@ jobs: id: gatsby-public-folder with: path: public/ - key: ${{ runner.os }}-public-gatsby-${{ github.ref }} + key: ${{ runner.os }}-public-gatsby-${{ github.refname }} restore-keys: | ${{ runner.os }}-public-gatsby-main From 96419573a860ef0361e0fbaeda4312206e39e5b5 Mon Sep 17 00:00:00 2001 From: Luca Osti Date: Tue, 6 Aug 2024 09:44:39 +0200 Subject: [PATCH 2/3] Use refname for staging cache key, too --- .github/workflows/deploy-staging.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 29b9914af1..d05741970d 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -49,7 +49,7 @@ jobs: id: gatsby-cache-folder with: path: .cache - key: ${{ runner.os }}-cache-gatsby-${{ github.ref }} + key: ${{ runner.os }}-cache-gatsby-${{ github.refname }} restore-keys: | ${{ runner.os }}-cache-gatsby-main @@ -58,7 +58,7 @@ jobs: id: gatsby-public-folder with: path: public/ - key: ${{ runner.os }}-public-gatsby-${{ github.ref }} + key: ${{ runner.os }}-public-gatsby-${{ github.refname }} restore-keys: | ${{ runner.os }}-public-gatsby-main From dce6da42a98da8687b9ed4673af75c75f7e42f11 Mon Sep 17 00:00:00 2001 From: Luca Osti Date: Tue, 6 Aug 2024 09:45:19 +0200 Subject: [PATCH 3/3] Use refname for preview, too --- .github/workflows/preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 6e2815cc0a..9d1175c96b 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -69,7 +69,7 @@ jobs: id: gatsby-cache-folder with: path: .cache - key: ${{ runner.os }}-cache-gatsby-${{ github.ref }} + key: ${{ runner.os }}-cache-gatsby-${{ github.refname }} restore-keys: | ${{ runner.os }}-cache-gatsby-main @@ -78,7 +78,7 @@ jobs: id: gatsby-public-folder with: path: public/ - key: ${{ runner.os }}-public-gatsby-${{ github.ref }} + key: ${{ runner.os }}-public-gatsby-${{ github.refname }} restore-keys: | ${{ runner.os }}-public-gatsby-main