Skip to content

Commit 1221693

Browse files
committed
feat: add caching for Node modules in GitHub Actions workflow
1 parent d754dbc commit 1221693

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ jobs:
2828
uses: actions/setup-node@v4
2929
with:
3030
node-version: 20
31+
- name: Cache Node modules
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.npm
36+
${{ github.workspace }}/.next/cache
37+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
38+
restore-keys: |
39+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
3140
- name: Build
3241
run: |
3342
npm ci

0 commit comments

Comments
 (0)