Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

The microsite at /docs/index.html required manual synchronization with the main application code whenever badge generation or sorting logic changed, creating maintenance burden and drift risk.

Changes

Build System

  • scripts/build_microsite.py: Generates docs/index.html from template, injecting commit hash
  • docs/index.template.html: Source template with {{COMMIT_HASH}} placeholder (tracked in git)
  • docs/index.html: Now generated during deployment (excluded from git via .gitignore)

Deployment Pipeline

  • .github/workflows/deploy-pages.yml: Builds and deploys to GitHub Pages on push to main
  • Triggers on changes to docs/**, badgesort/**, or build scripts
  • Supports manual dispatch

Documentation

  • docs/BUILD_SYSTEM.md: Architecture, sync checklists for keeping CLI/microsite algorithms aligned
  • docs/README.md: Build and deployment workflow
  • README.md: Live site link at https://chipwolf.github.io/BadgeSort/

Result

<!-- Deployed site now shows build information -->
<p>Build: <code>467e2a8</code></p>

Microsite automatically rebuilds and deploys on every push. Commit hash visible on live site for version transparency.

Setup Required

Repository Settings → Pages → Source: "GitHub Actions" (not branch-based)

Original prompt

This section details on the original issue you should resolve

<issue_title>Deduplicate code between BadgeSort and the microsite</issue_title>
<issue_description>Currently the program is in /badgesort and our microsite is in /docs

We use the python from the app in the microsite

However, when we update the app we need to manually sync those changes into the microsite

Write a replacement GitHub action to deploy the GitHub pages site that grabs the latest version of the code so we only keep one copy in the repo

You may need to work out what the differences are between the code in the microsite and the actual BadgeSort code and the site may need some kind of wrapper, but perhaps not.

Make sure the site shows the commit hash somewhere too</issue_description>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits October 28, 2025 21:41
- Create build script (scripts/build_microsite.py) to generate microsite with commit hash
- Create GitHub Actions workflow (.github/workflows/deploy-pages.yml) for automated deployment
- Split docs/index.html into docs/index.template.html (source) and generated output
- Add commit hash display to microsite header
- Update .gitignore to exclude generated docs/index.html
- Update docs/README.md with build and deployment documentation

Co-authored-by: ChipWolf <3164166+ChipWolf@users.noreply.github.com>
- Update main README.md with live site link and build info
- Add comprehensive BUILD_SYSTEM.md documentation
- Document the automated build and deployment process

Co-authored-by: ChipWolf <3164166+ChipWolf@users.noreply.github.com>
- Remove docs/index.html from git tracking (it's generated during deployment)
- Add detailed checklist for keeping CLI and microsite code in sync
- Improve BUILD_SYSTEM.md with specific guidance on maintaining consistency

Co-authored-by: ChipWolf <3164166+ChipWolf@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub action to deploy latest BadgeSort code Automate microsite deployment with build script and GitHub Actions Oct 28, 2025
Copilot AI requested a review from ChipWolf October 28, 2025 21:51
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.

Deduplicate code between BadgeSort and the microsite

2 participants