Skip to content

Commit 65ed883

Browse files
Config for github pages.
1 parent 320ea10 commit 65ed883

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/nextjs.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy Next.js site to Pages
44
on:
55
# Trigger on pushes to the default branch
66
push:
7-
branches: ["main"]
7+
branches: ['main']
88

99
# Allow manual triggering from the Actions tab
1010
workflow_dispatch:
@@ -17,7 +17,7 @@ permissions:
1717

1818
# Allow only one deployment at a time
1919
concurrency:
20-
group: "pages"
20+
group: 'pages'
2121
cancel-in-progress: false
2222

2323
jobs:
@@ -31,15 +31,15 @@ jobs:
3131
- name: Setup Node.js
3232
uses: actions/setup-node@v4
3333
with:
34-
node-version: "20"
35-
cache: "yarn"
34+
node-version: '20'
35+
cache: 'yarn'
3636

3737
- name: Install dependencies
3838
run: yarn install
3939

4040
- name: Configure Next.js for GitHub Pages
4141
run: |
42-
echo 'module.exports = { output: "export", basePath: "/<REPOSITORY-NAME>", trailingSlash: true }' > next.config.js
42+
echo 'module.exports = { output: "export", basePath: "/codebuilder-frontend, trailingSlash: true }' > next.config.js
4343
cat next.config.js
4444
4545
- name: Build Next.js site

next.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ module.exports = {
33
eslint: {
44
ignoreDuringBuilds: true,
55
},
6+
output: 'export',
7+
basePath: '/codebuilder-frontend', // Replace with your GitHub repository name
8+
trailingSlash: true, // Ensures compatibility with GitHub Pages
69
}

0 commit comments

Comments
 (0)