Fix GitHub Pages deployment by removing duplicate build step#13
Conversation
…y workflow Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
|
Duplicate deploy has been removed in #10. Branch has been updated with latest state. Issue still remains, Source is just this: |
I can confirm the build configuration is working correctly locally - it generates relative paths ( The GitHub Pages deployment may be serving a cached version. Try:
The workflow at commit 55069ca should generate the correct relative paths. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
lets temporarily deploy from any branch, so we can test. Comment out the if statement that blocks the deploy from another branch then main |
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Done! I've commented out the if statement that restricts deployment to main branch. The workflow will now deploy from any branch for testing purposes. See commit 4e30c94. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The GitHub Pages deployment was showing a blank page because the GitHub Actions workflow was running two conflicting build commands that overwrote each other.
Issue
The deployed page appeared blank with no CSS or JavaScript loading, as shown in the issue screenshot. Users would see only black text on a white background with no styling.
Root Cause
The GitHub Actions workflow in
.github/workflows/deploy-to-pages.ymlwas running two build commands:npm run build:pages- Creates correct GitHub Pages build with relative paths (base: './')npm run build- Overwrites it with regular build using absolute paths (base: '/github-copilot-usage/')The second build would overwrite the GitHub Pages optimized build, resulting in incorrect asset paths that failed to load on GitHub Pages.
Solution
Removed the duplicate
npm run buildstep from the GitHub Actions workflow. Now onlynpm run build:pagesruns, which:vite.github-pages.config.tswithbase: './'for relative paths@github/sparkdependencies that aren't available in GitHub Pagesindex.htmlwith relative asset references like./assets/index-XXX.jsVerification
Fixes #12.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.