Skip to content

Commit bd44746

Browse files
committed
fix: try build with pnpm
1 parent 3db9ffd commit bd44746

File tree

2 files changed

+14
-6785
lines changed

2 files changed

+14
-6785
lines changed

.github/workflows/nextjs.yml

+14-43
Original file line numberDiff line numberDiff line change
@@ -28,55 +28,26 @@ jobs:
2828
# Build job
2929
build:
3030
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
node-version: [20]
3134
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v3
34-
- name: Detect package manager
35-
id: detect-package-manager
36-
run: |
37-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
38-
echo "manager=yarn" >> $GITHUB_OUTPUT
39-
echo "command=install" >> $GITHUB_OUTPUT
40-
echo "runner=yarn" >> $GITHUB_OUTPUT
41-
exit 0
42-
elif [ -f "${{ github.workspace }}/package.json" ]; then
43-
echo "manager=npm" >> $GITHUB_OUTPUT
44-
echo "command=ci" >> $GITHUB_OUTPUT
45-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
46-
exit 0
47-
else
48-
echo "Unable to determine package manager"
49-
exit 1
50-
fi
51-
- name: Setup Node
35+
- uses: actions/checkout@v4
36+
- name: Install pnpm
37+
uses: pnpm/action-setup@v4
38+
with:
39+
version: 9
40+
- name: Use Node.js ${{ matrix.node-version }}
5241
uses: actions/setup-node@v4
5342
with:
54-
node-version: "20"
55-
cache: ${{ steps.detect-package-manager.outputs.manager }}
43+
node-version: ${{ matrix.node-version }}
44+
cache: 'pnpm'
45+
- name: Install dependencies
46+
run: pnpm install
5647
- name: Setup Pages
5748
uses: actions/configure-pages@v5
58-
# with:
59-
# Automatically inject basePath in your Next.js configuration file and disable
60-
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
61-
#
62-
# You may remove this line if you want to manage the configuration yourself.
63-
# static_site_generator: next
64-
- name: Restore cache
65-
uses: actions/cache@v3
66-
with:
67-
path: |
68-
.next/cache
69-
# Generate a new cache whenever packages or source files change.
70-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
71-
# If source files changed but packages didn't, rebuild from a prior cache.
72-
restore-keys: |
73-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
74-
- name: Install dependencies
75-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
7649
- name: Build with Next.js
77-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
78-
# - name: Static HTML export with Next.js
79-
# run: ${{ steps.detect-package-manager.outputs.runner }} next export
50+
run: pnpm next build
8051
- name: Upload artifact
8152
uses: actions/upload-pages-artifact@v3
8253
with:

0 commit comments

Comments
 (0)