Skip to content

Commit 3372a8a

Browse files
Merge pull request #219 from gitroomhq/ci-build-cache
Add NEXT JS Build cache
2 parents 0fb5de5 + 56d04d9 commit 3372a8a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/build.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build
23

34
on:
@@ -20,5 +21,18 @@ jobs:
2021
with:
2122
node-version: ${{ matrix.node-version }}
2223
cache: 'npm'
24+
25+
# https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
26+
- uses: actions/cache@v4
27+
with:
28+
path: |
29+
~/.npm
30+
${{ github.workspace }}/.next/cache
31+
32+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
33+
restore-keys: |
34+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
35+
36+
2337
- run: npm ci
2438
- run: npm run build

0 commit comments

Comments
 (0)