Skip to content

Commit 8329dfa

Browse files
committed
CI: Deploy with pnpm for Next.js site (setup pnpm + cache store, install with pnpm, build with pnpm)
1 parent 0ce4c5a commit 8329dfa

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/deploy-site.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,28 @@ jobs:
3939
uses: actions/setup-node@v4
4040
with:
4141
node-version: '20'
42-
cache: npm
43-
cache-dependency-path: site/package-lock.json
42+
43+
- name: Setup pnpm
44+
uses: pnpm/action-setup@v4
45+
with:
46+
version: latest
47+
48+
- name: Get pnpm store directory
49+
shell: bash
50+
run: |
51+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
52+
53+
- name: Setup pnpm cache
54+
uses: actions/cache@v4
55+
with:
56+
path: ${{ env.STORE_PATH }}
57+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
58+
restore-keys: |
59+
${{ runner.os }}-pnpm-store-
4460
4561
- name: Install site dependencies
4662
run: |
47-
cd site && npm ci
63+
cd site && pnpm install --frozen-lockfile
4864
4965
- name: Setup Pages
5066
uses: actions/configure-pages@v4
@@ -68,7 +84,7 @@ jobs:
6884
ruby scripts/export_typescript_types.rb
6985
7086
- name: Build with Next.js
71-
run: cd site && npm run build
87+
run: cd site && pnpm run build
7288

7389
- name: Upload artifact
7490
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)