Fix build configuration and add PR preview workflow for volttron.org deployment #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The site was not deploying correctly to https://volttron.org. Investigation revealed that the repository contained committed build artifacts from a development build rather than a production build, causing several critical issues:
http://localhost:1313URLs instead of the production URLpublic/directory (449 files) andresources/directory (8 files) were committed to version controlCNAMEand.nojekyllfiles were in the wrong locationSolution
Removed Build Artifacts from Version Control
public/directory that were generated with development URLsresources/directory (Hugo cache)public/,resources/, and.hugo_build.lockto.gitignoreto prevent future commitsFixed Configuration
hugo.tomlbaseURL tohttps://volttron.org/config/_default/config.tomlbaseURL tohttps://volttron.org/Fixed Deployment Files
CNAMEfrom repository root tostatic/CNAME.nojekyllfrom repository root tostatic/.nojekyllstatic/to the root ofpublic/during build, ensuring these files are included in the deployed siteEnhanced Documentation
README.mdwith clear instructions distinguishing between development (hugo serve) and production (hugo --gc --minify) buildsDEPLOYMENT.mdwith comprehensive deployment guide covering:Added PR Preview Workflow
.github/workflows/pr-preview.yamlto automatically build and test site changes in pull requestsVerification
✅ Production build with
hugo --gc --minifysucceeds✅ Generated HTML contains
https://volttron.org/URLs (255+ occurrences)✅ Zero
localhost:1313references in generated files✅ Zero livereload scripts in generated files
✅
CNAMEfile correctly included inpublic/with "volttron.org"✅
.nojekyllfile correctly included inpublic/✅ Git submodules configured correctly for theme
✅ PR preview workflow YAML validated
Impact
Once merged to
main, the GitHub Actions workflow will automatically build and deploy the site correctly to https://volttron.org with proper URLs throughout. The.gitignorechanges prevent future accidental commits of build artifacts, and the enhanced documentation helps prevent this issue from recurring.For future pull requests, the new PR preview workflow will automatically build the site and provide downloadable artifacts, allowing reviewers to test changes locally before they are deployed to production.
Testing
Tested complete build process locally simulating the GitHub Actions workflow:
git submodule update --init --recursive rm -rf public/ resources/ HUGO_ENVIRONMENT=production HUGO_ENV=production hugo --gc --minify # Verified all URLs are correct and CNAME/nojekyll files are presentValidated PR preview workflow YAML syntax to ensure it will execute correctly.
Fixes #26
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.