Skip to content

Commit d6749c2

Browse files
committed
chore: configure GitHub Pages deployment with asset prefix
- Add ASSET_PREFIX environment variable to GitHub Actions workflow - Configure assetPrefix in next.config.js for proper static asset loading - Ensure CSS and assets load correctly on GitHub Pages subdirectory
1 parent a57ee8e commit d6749c2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676
- name: Build with Next.js
7777
run: ${{ steps.detect-package-manager.outputs.runner }} next build
7878
working-directory: ./apps/web
79+
env:
80+
NODE_ENV: production
81+
ASSET_PREFIX: /RestroFX/
7982

8083
- name: Upload artifact
8184
uses: actions/upload-pages-artifact@v3

apps/web/next.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ const nextConfig = {
55
// basePath will be auto-injected by GitHub Actions configure-pages action
66
// Don't set it here to allow the action to inject it correctly
77
trailingSlash: true,
8-
// assetPrefix will be automatically set to match basePath by Next.js
8+
// assetPrefix is required for CSS and other static assets to load correctly on GitHub Pages
9+
// It must match the basePath (with trailing slash)
10+
// Use environment variable if set, otherwise default to /RestroFX/ for production builds
11+
assetPrefix: process.env.ASSET_PREFIX || (process.env.NODE_ENV === 'production' ? '/RestroFX/' : ''),
912
transpilePackages: ["@crimsonfx/ui", "@crimsonfx/utils", "@crimsonfx/types"],
1013
images: {
1114
unoptimized: true,

0 commit comments

Comments
 (0)