Skip to content

Commit d8d8b53

Browse files
authored
Allow busting reserved Github action caches (vercel#66638)
1 parent 6795597 commit d8d8b53

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
id: cache-build
6767
with:
6868
path: ./*
69-
key: ${{ github.sha }}-${{ github.run_number }}
69+
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt}}
7070

7171
# Build binaries for publishing
7272
build-native:
@@ -432,7 +432,12 @@ jobs:
432432
id: restore-build
433433
with:
434434
path: ./*
435-
key: ${{ github.sha }}-${{ github.run_number }}
435+
# Cache includes repo checkout which is required for later scripts
436+
fail-on-cache-miss: true
437+
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
438+
restore-keys: |
439+
${{ github.sha }}-${{ github.run_number }}
440+
${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt}}
436441
437442
- uses: actions/download-artifact@v4
438443
with:
@@ -480,7 +485,12 @@ jobs:
480485
id: restore-build
481486
with:
482487
path: ./*
483-
key: ${{ github.sha }}-${{ github.run_number }}
488+
# Cache includes repo checkout which is required for later scripts
489+
fail-on-cache-miss: true
490+
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
491+
restore-keys: |
492+
${{ github.sha }}-${{ github.run_number }}
493+
${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt}}
484494
485495
- uses: actions/download-artifact@v4
486496
with:

0 commit comments

Comments
 (0)