@@ -28,7 +28,7 @@ concurrency:
2828env :
2929 GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
3030 GH_TOKEN : ${{ secrets.GH_TOKEN }}
31- NEXT_PUBLIC_APP_NAME : ${{ secrets.NEXT_PUBLIC_APP_NAME }}
31+ NEXT_PUBLIC_APP_NAME : ${{ secrets.NEXT_PUBLIC_APP_NAME }}
3232 NEXT_PUBLIC_APP_DESCRIPTION : ${{ secrets.NEXT_PUBLIC_APP_DESCRIPTION }}
3333 CACHE_DURATION : ${{ secrets.CACHE_DURATION }}
3434 MAX_REQUESTS_PER_HOUR : ${{ secrets.MAX_REQUESTS_PER_HOUR }}
@@ -42,50 +42,37 @@ jobs:
4242 steps :
4343 - name : Checkout
4444 uses : actions/checkout@v4
45- - name : Detect package manager
46- id : detect-package-manager
47- run : |
48- if [ -f "${{ github.workspace }}/yarn.lock" ]; then
49- echo "manager=yarn" >> $GITHUB_OUTPUT
50- echo "command=install" >> $GITHUB_OUTPUT
51- echo "runner=yarn" >> $GITHUB_OUTPUT
52- exit 0
53- elif [ -f "${{ github.workspace }}/package.json" ]; then
54- echo "manager=npm" >> $GITHUB_OUTPUT
55- echo "command=ci" >> $GITHUB_OUTPUT
56- echo "runner=npx --no-install" >> $GITHUB_OUTPUT
57- exit 0
58- else
59- echo "Unable to determine package manager"
60- exit 1
61- fi
45+
46+ - name : Setup pnpm
47+ uses : pnpm/action-setup@v2
48+ with :
49+ version : 8
50+
6251 - name : Setup Node
6352 uses : actions/setup-node@v4
6453 with :
6554 node-version : " 20"
66- cache : ${{ steps.detect-package-manager.outputs.manager }}
55+ cache : ' pnpm'
56+
6757 - name : Setup Pages
6858 uses : actions/configure-pages@v5
6959 with :
70- # Automatically inject basePath in your Next.js configuration file and disable
71- # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
72- #
73- # You may remove this line if you want to manage the configuration yourself.
7460 static_site_generator : next
61+
7562 - name : Restore cache
7663 uses : actions/cache@v4
7764 with :
7865 path : |
7966 .next/cache
80- # Generate a new cache whenever packages or source files change.
81- key : ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
82- # If source files changed but packages didn't, rebuild from a prior cache.
67+ key : ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
8368 restore-keys : |
84- ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
69+ ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
70+
8571 - name : Install dependencies
86- run : ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
72+ run : pnpm install --frozen-lockfile
73+
8774 - name : Build with Next.js
88- run : ${{ steps.detect-package-manager.outputs.runner }} next build
75+ run : pnpm build
8976 env :
9077 GH_TOKEN : ${{ secrets.GH_TOKEN }}
9178
0 commit comments