Skip to content

Commit

Permalink
ci: try hash using git hash
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyaaa committed Aug 8, 2024
1 parent a2c0ef5 commit 74bb1b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/run-tests-debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ jobs:
- name: Set up Yarn
uses: threeal/[email protected]

- name: Get last git commit hash
run: |
echo "DIFF_HASH=$(git log -1 --pretty=format:%H)" >> $GITHUB_ENV
- name: Cache NextJS
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ env.DIFF_HASH }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
Expand Down

0 comments on commit 74bb1b7

Please sign in to comment.