Skip to content

Commit c17f840

Browse files
committed
ci: cache
1 parent 799517f commit c17f840

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/main.yml

+13
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ jobs:
1919
with:
2020
version: latest
2121

22+
- name: Cache
23+
uses: actions/cache@v4
24+
with:
25+
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
26+
path: |
27+
~/.npm
28+
${{ github.workspace }}/.next/cache
29+
# Generate a new cache whenever packages or source files change.
30+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
31+
# If source files changed but packages didn't, rebuild from a prior cache.
32+
restore-keys: |
33+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
34+
2235
- name: Install
2336
run: pnpm i
2437

0 commit comments

Comments
 (0)