Skip to content

Commit 19f9c23

Browse files
authored
Update nextjs.yml
1 parent 32ebc47 commit 19f9c23

File tree

1 file changed

+9
-40
lines changed

1 file changed

+9
-40
lines changed

.github/workflows/nextjs.yml

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
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
1+
name: Check NextJs build
62

73
on:
84
# Runs on pushes targeting the default branch
95
push:
106
branches: ["main"]
7+
8+
# Runs on any open or reopened pull request
9+
pull_request:
10+
types: [opened, reopened] # you can change this according to https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#using-multiple-events
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
1414

1515
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1616
permissions:
1717
contents: read
18-
pages: write
1918
id-token: write
2019

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
26-
2720
jobs:
2821
# Build job
2922
build:
@@ -45,22 +38,14 @@ jobs:
4538
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
4639
exit 0
4740
else
48-
echo "Unable to determine package manager"
41+
echo "Unable to determine package manager" >&2
4942
exit 1
5043
fi
5144
- name: Setup Node
52-
uses: actions/setup-node@v4
45+
uses: actions/setup-node@v3
5346
with:
54-
node-version: "20"
47+
node-version: "22"
5548
cache: ${{ steps.detect-package-manager.outputs.manager }}
56-
- name: Setup Pages
57-
uses: actions/configure-pages@v5
58-
with:
59-
# Automatically inject basePath in your Next.js configuration file and disable
60-
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
61-
#
62-
# You may remove this line if you want to manage the configuration yourself.
63-
static_site_generator: next
6449
- name: Restore cache
6550
uses: actions/cache@v4
6651
with:
@@ -74,20 +59,4 @@ jobs:
7459
- name: Install dependencies
7560
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
7661
- name: Build with Next.js
77-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
78-
- name: Upload artifact
79-
uses: actions/upload-pages-artifact@v3
80-
with:
81-
path: ./out
82-
83-
# Deployment job
84-
deploy:
85-
environment:
86-
name: github-pages
87-
url: ${{ steps.deployment.outputs.page_url }}
88-
runs-on: ubuntu-latest
89-
needs: build
90-
steps:
91-
- name: Deploy to GitHub Pages
92-
id: deployment
93-
uses: actions/deploy-pages@v4
62+
run: npm run build

0 commit comments

Comments
 (0)