Skip to content

Commit 1f9528f

Browse files
authored
Merge pull request #2097 from arduino/serjlee/maybe-fix-caches
Use per-branch cache during builds
2 parents 925ba8b + 1b80571 commit 1f9528f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.github/workflows/deploy-production.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ jobs:
5050
id: gatsby-cache-folder
5151
with:
5252
path: .cache
53-
key: ${{ runner.os }}-cache-gatsby-${{ github.sha }}
53+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref }}
5454
restore-keys: |
55-
${{ runner.os }}-cache-gatsby-
55+
${{ runner.os }}-cache-gatsby-main
5656
5757
- name: Gatsby Public Folder
5858
uses: actions/cache@v4
5959
id: gatsby-public-folder
6060
with:
6161
path: public/
62-
key: ${{ runner.os }}-public-gatsby-${{ github.sha }}
62+
key: ${{ runner.os }}-public-gatsby-${{ github.ref }}
6363
restore-keys: |
64-
${{ runner.os }}-public-gatsby-
64+
${{ runner.os }}-public-gatsby-main
6565
6666
- run: npm install
6767
- run: npm run build

.github/workflows/deploy-staging.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ jobs:
4949
id: gatsby-cache-folder
5050
with:
5151
path: .cache
52-
key: ${{ runner.os }}-cache-gatsby-${{ github.sha }}
52+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref }}
5353
restore-keys: |
54-
${{ runner.os }}-cache-gatsby-
54+
${{ runner.os }}-cache-gatsby-main
5555
5656
- name: Gatsby Public Folder
5757
uses: actions/cache@v4
5858
id: gatsby-public-folder
5959
with:
6060
path: public/
61-
key: ${{ runner.os }}-public-gatsby-${{ github.sha }}
61+
key: ${{ runner.os }}-public-gatsby-${{ github.ref }}
6262
restore-keys: |
63-
${{ runner.os }}-public-gatsby-
63+
${{ runner.os }}-public-gatsby-main
6464
6565
- run: npm install
6666
- run: npm run build

.github/workflows/preview.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ jobs:
6969
id: gatsby-cache-folder
7070
with:
7171
path: .cache
72-
key: ${{ runner.os }}-cache-gatsby-${{ github.sha }}
72+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref }}
7373
restore-keys: |
74-
${{ runner.os }}-cache-gatsby-
74+
${{ runner.os }}-cache-gatsby-main
7575
7676
- name: Gatsby Public Folder
7777
uses: actions/cache@v4
7878
id: gatsby-public-folder
7979
with:
8080
path: public/
81-
key: ${{ runner.os }}-public-gatsby-${{ github.sha }}
81+
key: ${{ runner.os }}-public-gatsby-${{ github.ref }}
8282
restore-keys: |
83-
${{ runner.os }}-public-gatsby-
83+
${{ runner.os }}-public-gatsby-main
8484
8585
- run: npm install
8686
- run: npm run build
@@ -135,4 +135,4 @@ jobs:
135135
body: |
136136
## Preview Deployment
137137
🚀 Preview this PR: ${{ steps.url_preview.outputs.NETLIFY_PREVIEW_URL }}
138-
📍 Commit SHA: ${{ github.sha }}
138+
📍 Commit SHA: ${{ github.sha }}

0 commit comments

Comments
 (0)