Skip to content

Commit 7799fab

Browse files
committed
Update to use pnpm
1 parent 309fb37 commit 7799fab

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/nextjs.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ jobs:
3434
- name: Detect package manager
3535
id: detect-package-manager
3636
run: |
37-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
37+
if [ -f "${{ github.workspace }}/pnpm-lock.yaml" ]; then
38+
echo "manager=pnpm" >> $GITHUB_OUTPUT
39+
echo "command=install" >> $GITHUB_OUTPUT
40+
echo "runner=pnpm" >> $GITHUB_OUTPUT
41+
exit 0
42+
elif [ -f "${{ github.workspace }}/yarn.lock" ]; then
3843
echo "manager=yarn" >> $GITHUB_OUTPUT
3944
echo "command=install" >> $GITHUB_OUTPUT
4045
echo "runner=yarn" >> $GITHUB_OUTPUT
@@ -53,6 +58,11 @@ jobs:
5358
with:
5459
node-version: "20"
5560
cache: ${{ steps.detect-package-manager.outputs.manager }}
61+
- name: Install pnpm
62+
if: ${{ steps.detect-package-manager.outputs.manager == 'pnpm' }}
63+
uses: pnpm/action-setup@v2
64+
with:
65+
version: '10.11.0'
5666
- name: Setup Pages
5767
uses: actions/configure-pages@v5
5868
with:
@@ -67,10 +77,10 @@ jobs:
6777
path: |
6878
.next/cache
6979
# 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') }}
80+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
7181
# If source files changed but packages didn't, rebuild from a prior cache.
7282
restore-keys: |
73-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
83+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
7484
- name: Install dependencies
7585
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
7686
- name: Build with Next.js

0 commit comments

Comments
 (0)