Skip to content

Commit 7b78de0

Browse files
authored
Update nextjs.yml
1 parent 38f1c2c commit 7b78de0

1 file changed

Lines changed: 46 additions & 10 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,62 @@
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+
17
on:
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

527
jobs:
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

0 commit comments

Comments
 (0)