Skip to content

Conversation

Copy link

Copilot AI commented Oct 3, 2025

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:

  • All generated HTML files contained http://localhost:1313 URLs instead of the production URL
  • Development-only livereload scripts were included in the HTML
  • The public/ directory (449 files) and resources/ directory (8 files) were committed to version control
  • Configuration files had incorrect baseURL values
  • CNAME and .nojekyll files were in the wrong location

Solution

Removed Build Artifacts from Version Control

  • Deleted 449 files from the public/ directory that were generated with development URLs
  • Deleted 8 files from the resources/ directory (Hugo cache)
  • Added public/, resources/, and .hugo_build.lock to .gitignore to prevent future commits

Fixed Configuration

  • Updated hugo.toml baseURL to https://volttron.org/
  • Updated config/_default/config.toml baseURL to https://volttron.org/
  • Both config files now consistently use the correct production URL

Fixed Deployment Files

  • Moved CNAME from repository root to static/CNAME
  • Moved .nojekyll from repository root to static/.nojekyll
  • Hugo automatically copies files from static/ to the root of public/ during build, ensuring these files are included in the deployed site

Enhanced Documentation

  • Updated README.md with clear instructions distinguishing between development (hugo serve) and production (hugo --gc --minify) builds
  • Created DEPLOYMENT.md with comprehensive deployment guide covering:
    • How GitHub Actions deployment works
    • Local development best practices
    • Important configuration files
    • Troubleshooting common issues
    • Pre-deployment checklist

Added PR Preview Workflow

  • Created .github/workflows/pr-preview.yaml to automatically build and test site changes in pull requests
  • Workflow generates a downloadable artifact for each PR with the built site
  • Automatically posts a comment on PRs with instructions for previewing changes locally
  • Enables safe testing of changes before merging to production
  • Artifacts are retained for 7 days for reviewer access

Verification

✅ Production build with hugo --gc --minify succeeds
✅ Generated HTML contains https://volttron.org/ URLs (255+ occurrences)
✅ Zero localhost:1313 references in generated files
✅ Zero livereload scripts in generated files
CNAME file correctly included in public/ with "volttron.org"
.nojekyll file correctly included in public/
✅ 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 .gitignore changes 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 present

Validated PR preview workflow YAML syntax to ensure it will execute correctly.

Fixes #26

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix the build issues for the site</issue_title>
<issue_description>The latest code does not seem to be working as far as publishing it out to the web. We should be able to test and see all changes at https://volttron.org</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #26

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits October 3, 2025 17:22
- Remove public/ directory from version control (build artifact)
- Remove resources/ directory from version control (build artifact)
- Add public/, resources/, and .hugo_build.lock to .gitignore
- Fix baseURL in both hugo.toml and config/_default/config.toml to use https://volttron.org/
- Update README with proper build instructions distinguishing dev vs production builds

Co-authored-by: craig8 <[email protected]>
Hugo copies files from static/ to public/ during build. These files need to be in the static directory so they're included in the deployed site.

Co-authored-by: craig8 <[email protected]>
Created DEPLOYMENT.md with detailed instructions on:
- How the GitHub Actions deployment works
- Local development vs production builds
- Important files and their purposes
- Troubleshooting common issues
- Deployment checklist

Co-authored-by: craig8 <[email protected]>
Copilot AI changed the title [WIP] Fix the build issues for the site Fix build configuration to deploy site correctly to volttron.org Oct 3, 2025
Copilot AI requested a review from craig8 October 3, 2025 17:29
Copilot finished work on behalf of craig8 October 3, 2025 17:29
@craig8 craig8 marked this pull request as ready for review October 3, 2025 18:45
@craig8
Copy link
Contributor

craig8 commented Oct 3, 2025

@copilot can you make a test version of the site before fully committing for PRs?

Created .github/workflows/pr-preview.yaml that:
- Builds the site automatically for all PRs
- Creates a downloadable artifact with the built site
- Posts a comment on the PR with preview instructions
- Allows reviewers to test changes locally before merging

Updated DEPLOYMENT.md to document the new PR preview workflow.

Co-authored-by: craig8 <[email protected]>
Copy link
Author

Copilot AI commented Oct 3, 2025

@copilot can you make a test version of the site before fully committing for PRs?

I've added a PR preview workflow in commit e0b2f2e.

The new .github/workflows/pr-preview.yaml workflow will:

  • Automatically build the site for every PR
  • Create a downloadable artifact (kept for 7 days)
  • Post a comment on the PR with instructions on how to preview the built site locally

Reviewers can download the artifact from the workflow run, extract it, and open index.html in a browser or use a local web server to test the changes before merging.

Copilot AI changed the title Fix build configuration to deploy site correctly to volttron.org Fix build configuration and add PR preview workflow for volttron.org deployment Oct 3, 2025
Copilot finished work on behalf of craig8 October 3, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the build issues for the site

2 participants