Skip to content

Commit 30c26b6

Browse files
committed
ci: use pnpm
1 parent 7f55d5d commit 30c26b6

File tree

1 file changed

+12
-25
lines changed

1 file changed

+12
-25
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,17 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v4
3030

31-
- name: Detect package manager
32-
id: detect-package-manager
33-
run: |
34-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
35-
echo "manager=yarn" >> $GITHUB_OUTPUT
36-
echo "command=install" >> $GITHUB_OUTPUT
37-
echo "runner=yarn" >> $GITHUB_OUTPUT
38-
exit 0
39-
elif [ -f "${{ github.workspace }}/package.json" ]; then
40-
echo "manager=npm" >> $GITHUB_OUTPUT
41-
echo "command=ci" >> $GITHUB_OUTPUT
42-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
43-
exit 0
44-
else
45-
echo "Unable to determine package manager"
46-
exit 1
47-
fi
31+
- uses: pnpm/action-setup@v4
32+
name: Install pnpm
33+
with:
34+
version: 9
35+
run_install: false
4836

49-
- name: Setup Node
37+
- name: Install Node.js
5038
uses: actions/setup-node@v4
5139
with:
52-
node-version: "lts/*"
53-
cache: ${{ steps.detect-package-manager.outputs.manager }}
40+
node-version: 20
41+
cache: "pnpm"
5442

5543
- name: Setup Pages
5644
uses: actions/configure-pages@v4
@@ -61,18 +49,17 @@ jobs:
6149
path: |
6250
.next/cache
6351
# Generate a new cache whenever packages or source files change.
64-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
65-
# If source files changed but packages didn't, rebuild from a prior cache.
52+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
6653
restore-keys: |
67-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
54+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
6855
6956
- name: Install dependencies
70-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
57+
run: pnpm i
7158

7259
- name: Build with Next.js
7360
env:
7461
NEXT_PUBLIC_PROXY_URL: "https://classcharts-proxy.veloi.workers.dev"
75-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
62+
run: pnpm build
7663

7764
- name: Upload artifact
7865
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)