Skip to content

Commit 3f3142b

Browse files
committed
Clean up build and deploy action
1 parent f99e04b commit 3f3142b

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

.github/workflows/build-and-deploy-nextjs-app.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Deploy Next.js site to Pages
22

33
on:
4-
# Runs on pushes targeting the default branch
54
push:
65
branches: ["main"]
76

@@ -14,8 +13,9 @@ permissions:
1413
pages: write
1514
id-token: write
1615

17-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
# Allow only one concurrent deployment, skipping runs queued between the run
17+
# in-progress and latest queued. However, do NOT cancel in-progress runs as we
18+
# want to allow these production deployments to complete.
1919
concurrency:
2020
group: "pages"
2121
cancel-in-progress: false
@@ -39,25 +39,20 @@ jobs:
3939

4040
- name: Setup Pages
4141
uses: actions/configure-pages@v5
42-
# with:
43-
# Automatically inject basePath in your Next.js configuration file and disable
44-
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
45-
#
46-
# You may remove this line if you want to manage the configuration yourself.
47-
# static_site_generator: next
4842

4943
- name: Install dependencies
5044
working-directory: ./app
5145
run: npm install
5246

47+
# This step writes BASE_PATH to $GITHUB_ENV so subsequent steps (including
48+
# the build) can read it as process.env.BASE_PATH.
5349
- name: Set BASE_PATH from repository name
54-
# This step writes BASE_PATH to $GITHUB_ENV so subsequent steps (including the build)
55-
# can read it as process.env.BASE_PATH.
5650
run: |
5751
# repo_name is the part after the slash in GITHUB_REPOSITORY (owner/repo)
5852
repo_name="${GITHUB_REPOSITORY##*/}"
5953
60-
# If this is a user/org pages repo like username.github.io, leave BASE_PATH empty (site is at root).
54+
# If this is a user/org pages repo like username.github.io, leave
55+
# BASE_PATH empty (site is at root).
6156
if [[ "$repo_name" == *.github.io ]]; then
6257
echo "BASE_PATH=" >> $GITHUB_ENV
6358
echo "Detected GitHub Pages user/org repo; setting BASE_PATH to empty."

0 commit comments

Comments
 (0)