File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Sample workflow for building and deploying a Next.js site to GitHub Pages
2+ #
3+ # To get started with Next.js see: https://nextjs.org/docs/getting-started
4+ #
5+ name : Deploy Next.js site to Pages
6+
17on :
2- - push
3- - pull_request
8+ # Runs on pushes targeting the default branch
9+ push :
10+ branches : ["main"]
11+
12+ # Allows you to run this workflow manually from the Actions tab
13+ workflow_dispatch :
14+
15+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+ permissions :
17+ contents : read
18+ pages : write
19+ id-token : write
20+
21+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+ concurrency :
24+ group : " pages"
25+ cancel-in-progress : false
426
527jobs :
6- cache-and-install :
28+ build :
729 runs-on : ubuntu-latest
8-
930 steps :
1031 - name : Checkout
1132 uses : actions/checkout@v4
1233
13- - uses : pnpm/action-setup@v4
14- name : Install pnpm
34+ - name : Setup pnpm
35+ uses : pnpm/action-setup@v4
1536 with :
1637 version : 10
17- run_install : false
1838
19- - name : Install Node.js
39+ - name : Setup Node.js
2040 uses : actions/setup-node@v4
2141 with :
22- node-version : 20
23- cache : ' pnpm'
42+ node-version : " 20"
43+ cache : pnpm
44+
45+ - name : Restore cache
46+ uses : actions/cache@v4
47+ with :
48+ path : .next/cache
49+ key : ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/[jt]s', '**/[jt]sx') }}
50+ restore-keys : |
51+ ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
2452
2553 - name : Install dependencies
2654 run : pnpm install
55+
56+ - name : Build with Next.js
57+ run : pnpm exec next build
58+
59+ - name : Upload artifact
60+ uses : actions/upload-pages-artifact@v3
61+ with :
62+ path : ./out
You can’t perform that action at this time.
0 commit comments