Skip to content

Commit fdf9432

Browse files
committed
Add caching
1 parent 30a48a4 commit fdf9432

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
lint:
1111
name: Lint and Format Check
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [22]
1316

1417
steps:
1518
- name: Checkout code
@@ -18,6 +21,23 @@ jobs:
1821
- name: Setup pnpm
1922
uses: pnpm/action-setup@v4
2023

24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v5
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: "pnpm"
29+
30+
- name: Confgiure Build Caching
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
${{ github.workspace }}/.next/cache
35+
# Generate a new cache whenever packages or source files change.
36+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
37+
# If source files changed but packages didn't, rebuild from a prior cache.
38+
restore-keys: |
39+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
40+
2141
- name: Install dependencies
2242
run: pnpm install --frozen-lockfile
2343

0 commit comments

Comments
 (0)