@@ -26,35 +26,35 @@ jobs:
26
26
id : detect-pm
27
27
run : |
28
28
if [ -f "pnpm-lock.yaml" ]; then
29
- echo "manager=pnpm" >> $GITHUB_OUTPUT
30
- echo "command=install" >> $GITHUB_OUTPUT
31
- echo "runner=pnpm exec" >> $GITHUB_OUTPUT
29
+ echo "manager=pnpm" >> $GITHUB_ENV
30
+ echo "command=install" >> $GITHUB_ENV
31
+ echo "runner=pnpm exec" >> $GITHUB_ENV
32
32
elif [ -f "yarn.lock" ]; then
33
- echo "manager=yarn" >> $GITHUB_OUTPUT
34
- echo "command=install" >> $GITHUB_OUTPUT
35
- echo "runner=yarn" >> $GITHUB_OUTPUT
33
+ echo "manager=yarn" >> $GITHUB_ENV
34
+ echo "command=install" >> $GITHUB_ENV
35
+ echo "runner=yarn" >> $GITHUB_ENV
36
36
else
37
- echo "manager=npm" >> $GITHUB_OUTPUT
38
- echo "command=ci" >> $GITHUB_OUTPUT
39
- echo "runner=npx --no-install" >> $GITHUB_OUTPUT
37
+ echo "manager=npm" >> $GITHUB_ENV
38
+ echo "command=ci" >> $GITHUB_ENV
39
+ echo "runner=npx --no-install" >> $GITHUB_ENV
40
40
fi
41
41
42
+ # ✅ Explicitly Install pnpm before setting up Node.js
43
+ - name : 📦 Install pnpm if needed
44
+ if : env.manager == 'pnpm'
45
+ run : npm install -g pnpm
46
+
42
47
- name : ⚙️ Setup Node.js
43
48
uses : actions/setup-node@v4
44
49
with :
45
50
node-version : ' 20'
46
- cache : ${{ steps.detect-pm.outputs.manager }}
47
-
48
- # Install pnpm if needed before verifying environment
49
- - name : 📦 Install Package Manager
50
- if : steps.detect-pm.outputs.manager == 'pnpm'
51
- run : npm install -g pnpm
51
+ cache : ${{ env.manager }}
52
52
53
53
- name : 📝 Verify Environment
54
54
run : |
55
55
echo "Node.js $(node -v)"
56
56
echo "npm $(npm -v)"
57
- ${{ steps.detect-pm.outputs .manager }} --version
57
+ ${{ env .manager }} --version
58
58
59
59
- name : 🌐 Setup Pages
60
60
uses : actions/configure-pages@v5
@@ -64,17 +64,16 @@ jobs:
64
64
- name : 📦 Restore cache
65
65
uses : actions/cache@v4
66
66
with :
67
- path : |
68
- .next/cache
69
- key : ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
67
+ path : .next/cache
68
+ key : nextjs-${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}
70
69
restore-keys : |
71
- ${{ runner.os }}- nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}-
70
+ nextjs-${{ runner.os }}-
72
71
73
72
- name : 📥 Install dependencies
74
- run : ${{ steps.detect-pm.outputs. manager }} ${{ steps.detect-pm.outputs .command }}
73
+ run : ${{ env. manager }} ${{ env .command }}
75
74
76
75
- name : 👷 Build with Next.js
77
- run : ${{ steps.detect-pm.outputs .runner }} next build
76
+ run : ${{ env .runner }} next build
78
77
79
78
- name : 📤 Upload artifact
80
79
uses : actions/upload-pages-artifact@v3
0 commit comments