Update Pages deployment to use staging directory - #290
Conversation
The workflow was uploading configurator/dist/ as the Pages root, so the app landed at /SLASHED/ instead of /SLASHED/configurator/. Stage the build into a _site/configurator/ subdirectory before uploading so the live URL matches the intended /configurator/ path. https://claude.ai/code/session_01LnGSUomuCzuzFSP9ST9PZo
📝 WalkthroughWalkthroughThe deploy-configurator workflow is updated to stage the configurator static build output into a ChangesGitHub Pages staging for configurator
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/deploy-configurator.yml:
- Around line 51-56: The Pages deployment now serves the app under
/configurator/, so update and verify the configurator build to use the base-path
environment variables injected by the actions/configure-pages step: inspect and,
if missing, update the configurator's build config (e.g., vite.config.js ->
base, next.config.js -> assetPrefix, webpack config -> publicPath or rollup ->
base) to read process.env (e.g., BASE_URL, PUBLIC_URL or the configure-pages
variables) and ensure the npm build script in configurator/package.json passes
those env vars during the build; also confirm the workflow still stages the
output into _site/configurator (the "Stage for Pages" step) after the build so
asset URLs resolve correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 23bc00bb-04aa-41b0-88be-acfe9e0bddef
📒 Files selected for processing (1)
.github/workflows/deploy-configurator.yml
| - name: Stage for Pages | ||
| run: mkdir -p _site/configurator && cp -r configurator/dist/. _site/configurator/ | ||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5 | ||
| with: | ||
| path: configurator/dist | ||
| path: _site |
There was a problem hiding this comment.
Verify the configurator build respects the nested deployment path.
The configurator will now be deployed at /SLASHED/configurator/ instead of /SLASHED/. The actions/configure-pages step (line 44) typically sets environment variables for the base URL, but you must verify that the configurator's build process actually uses these variables to configure the base path for asset references (JS, CSS, images, etc.).
If the build doesn't use the correct base path, the deployed app will have broken asset URLs resulting in 404 errors.
Run the following script to check if the configurator's build configuration uses the base path:
#!/bin/bash
# Description: Check configurator build config for base path configuration
# Look for common build config files and check if they reference base path or environment variables
echo "=== Checking for build configuration files ==="
fd -t f 'vite.config|next.config|webpack.config|rollup.config' configurator/
echo -e "\n=== Checking for base path configuration in build configs ==="
rg -n -C3 --type-add 'config:*.{js,ts,mjs,cjs}' --type config \
-e 'base:?\s*process\.env' \
-e 'basePath' \
-e 'BASE_URL' \
-e 'publicPath' \
configurator/
echo -e "\n=== Checking package.json build scripts ==="
cat configurator/package.json | jq -r '.scripts | to_entries[] | select(.key | test("build|prebuild")) | "\(.key): \(.value)"'Expected: The configurator should use environment variables set by configure-pages (such as GITHUB_PAGES, base URL, etc.) to configure the base path during the build step.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/deploy-configurator.yml around lines 51 - 56, The Pages
deployment now serves the app under /configurator/, so update and verify the
configurator build to use the base-path environment variables injected by the
actions/configure-pages step: inspect and, if missing, update the configurator's
build config (e.g., vite.config.js -> base, next.config.js -> assetPrefix,
webpack config -> publicPath or rollup -> base) to read process.env (e.g.,
BASE_URL, PUBLIC_URL or the configure-pages variables) and ensure the npm build
script in configurator/package.json passes those env vars during the build; also
confirm the workflow still stages the output into _site/configurator (the "Stage
for Pages" step) after the build so asset URLs resolve correctly.
Summary
Modified the GitHub Pages deployment workflow to stage build artifacts in a
_sitedirectory before uploading, rather than uploading the build output directly.Key Changes
_site/configuratordirectory and copies the built configurator distribution files into it_sitedirectory instead ofconfigurator/distImplementation Details
This change allows for a more flexible deployment structure where multiple artifacts or projects can be staged in the
_sitedirectory before being published to GitHub Pages. The configurator build output is now nested under_site/configurator/rather than being uploaded as the root artifact, which enables better organization if additional content needs to be deployed alongside it in the future.https://claude.ai/code/session_01LnGSUomuCzuzFSP9ST9PZo
Summary by CodeRabbit
Chores