1- name : Deploy to GitHub Pages
1+ name : Deploy Next.js site to Pages
22
33on :
44 push :
@@ -10,9 +10,11 @@ permissions:
1010 pages : write
1111 id-token : write
1212
13+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
14+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1315concurrency :
1416 group : " pages"
15- cancel-in-progress : true
17+ cancel-in-progress : false
1618
1719jobs :
1820 build :
@@ -23,26 +25,33 @@ jobs:
2325 - uses : pnpm/action-setup@v4
2426 with :
2527 run_install : true # package manager version is in package.json
28+ - name : Setup Node
29+ uses : actions/setup-node@v4
30+ with :
31+ node-version : " 24"
32+ cache : pnpm
2633 - name : Setup Pages
27- uses : actions/configure-pages@v4
34+ uses : actions/configure-pages@v5
35+ - name : Restore cache
36+ uses : actions/cache@v4
2837 with :
29- static_site_generator : next
30-
38+ path : |
39+ .next/cache
40+ # Generate a new cache whenever packages or source files change.
41+ key : ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
42+ # If source files changed but packages didn't, rebuild from a prior cache.
43+ restore-keys : |
44+ ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
45+ - name : Install dependencies
46+ run : pnpm install --frozen-lockfile
3147 - name : Build with Next.js
3248 run : pnpm run build
33-
34- - name : Verify build output
35- run : |
36- echo "Contents of current directory:"
37- ls -la
38- echo "Contents of out directory:"
39- ls -la out/ || echo "out directory does not exist"
40-
4149 - name : Upload artifact
4250 uses : actions/upload-pages-artifact@v3
4351 with :
4452 path : ./out
4553
54+ # Deployment job
4655 deploy :
4756 environment :
4857 name : github-pages
0 commit comments