Skip to content

Commit 557c14f

Browse files
committed
Update deployment configuration for GitHub Pages and adjust base path handling
1 parent 97bd4a7 commit 557c14f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,19 @@ jobs:
3333
run: npm ci
3434

3535
- name: Setup Pages
36+
id: pages
3637
uses: actions/configure-pages@v4
3738
with:
38-
static_site_generator: next
39+
static_site_generator: other
40+
41+
3942

4043
- name: Build with Next.js
4144
run: npm run build
4245
env:
4346
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL || 'https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}' }}
47+
NEXT_PUBLIC_SITE_URL: ${{ steps.pages.outputs.base_url }}
48+
NEXT_PUBLIC_BASE_PATH: ${{ steps.pages.outputs.base_path }}
4549
NEXT_STATIC_EXPORT: "true"
4650
NODE_ENV: "production"
4751

next.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ console.debug(` isProd: ${isProd}`);
1010
console.debug(` isStaticExport: ${isStaticExport}`);
1111

1212
// GitHub Pages configuration
13-
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "/plugins-doc-site";
13+
const basePath = process.env.NEXT_PUBLIC_BASE_PATH !== undefined
14+
? process.env.NEXT_PUBLIC_BASE_PATH
15+
: "/plugins-doc-site";
16+
1417

1518
/** @type {import('next').NextConfig} */
1619
const config = {

0 commit comments

Comments
 (0)