Add NEXT JS Build cache

This commit is contained in:
jamesread 2024-09-09 20:22:58 +01:00
parent 0fb5de5803
commit 56d04d962e
1 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,4 @@
---
name: Build
on:
@ -20,5 +21,18 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
- uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- run: npm ci
- run: npm run build