@@ -29,39 +29,22 @@ jobs:
2929 runs-on : ubuntu-latest
3030 steps :
3131 - name : Checkout
32- uses : actions/checkout@v3
33- - name : Detect package manager
34- id : detect-package-manager
35- run : |
36- if [ -f "${{ github.workspace }}/yarn.lock" ]; then
37- echo "::set-output name=manager::yarn"
38- echo "::set-output name=command::install"
39- echo "::set-output name=runner::yarn"
40- exit 0
41- elif [ -f "${{ github.workspace }}/package.json" ]; then
42- echo "::set-output name=manager::npm"
43- echo "::set-output name=command::ci"
44- echo "::set-output name=runner::npx --no-install"
45- exit 0
46- else
47- echo "Unable to determine packager manager"
48- exit 1
49- fi
32+ uses : actions/checkout@v4
5033 - name : Setup Node
51- uses : actions/setup-node@v3
34+ uses : actions/setup-node@v4
5235 with :
53- node-version : ' 20 '
54- cache : ${{ steps.detect-package-manager.outputs.manager }}
36+ node-version-file : .tool-versions
37+ cache : npm
5538 - name : Setup Pages
56- uses : actions/configure-pages@v2
39+ uses : actions/configure-pages@v5
5740 with :
5841 # Automatically inject basePath in your Next.js configuration file and disable
5942 # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
6043 #
6144 # You may remove this line if you want to manage the configuration yourself.
6245 static_site_generator : next
6346 - name : Restore cache
64- uses : actions/cache@v3
47+ uses : actions/cache@v4
6548 with :
6649 path : |
6750 .next/cache
7154 restore-keys : |
7255 ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
7356 - name : Install dependencies
74- run : ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
57+ run : npm ci
7558 - name : Build with Next.js
76- run : ${{ steps.detect-package-manager.outputs.runner }} next build
59+ run : npm run build
7760 - name : Upload artifact
7861 uses : actions/upload-pages-artifact@v3
7962 with :
0 commit comments