Skip to content

Commit

Permalink
chore: Update GitHub Actions workflow to include Next.js cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Mearman committed Sep 2, 2024
1 parent 0d70d35 commit 4a638e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 18.x
Expand All @@ -48,6 +49,15 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Next.js cache # see 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 --if-present
- run: npm run test --if-present

0 comments on commit 4a638e7

Please sign in to comment.