Skip to content

Commit

Permalink
Add cache in CD for Next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoretsu committed Jan 5, 2024
1 parent f572d4c commit cd1b69c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ jobs:
node-version: "lts/*"
cache: "pnpm"

- name: 🏗 Cache Next.js files
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-

- name: 📦 Install dependencies
run: pnpm i

Expand Down

0 comments on commit cd1b69c

Please sign in to comment.