Skip to content

Harden GitHub Pages demo deployment for stable latest-build links - #7

Merged
luke-b merged 10 commits into
mainfrom
copilot/explore-codebase-fix-404-badge
May 7, 2026
Merged

Harden GitHub Pages demo deployment for stable latest-build links#7
luke-b merged 10 commits into
mainfrom
copilot/explore-codebase-fix-404-badge

Conversation

Copilot AI commented May 7, 2026

Copy link
Copy Markdown
Contributor

The README badge points to a stable demo/build/latest/ URL, but the Pages deployment was still fragile: the workflow published the SHA build and latest redirect in separate pushes, which could leave latest/ stale or missing and surface as a 404. This change makes the Pages publish atomic and adds retention controls for accumulated demo artifacts.

  • Atomic Pages publish

    • Stage both outputs into one deploy tree:
      • demo/build/<short-sha>/index.html
      • demo/build/<short-sha>/hra.jsdos
      • demo/build/latest/index.html
    • Replace the two sequential peaceiris/actions-gh-pages publishes with a single publish to demo/build
  • Stable latest-path verification

    • Add post-deploy smoke checks for:
      • https://luke-b.github.io/DosTest/demo/build/<short-sha>/
      • https://luke-b.github.io/DosTest/demo/build/latest/
    • Keep retries short so transient propagation delays are tolerated without materially slowing the workflow
  • gh-pages retention / pruning

    • Check out gh-pages in the workflow and keep only the newest retained SHA build directories
    • Exclude latest/ from pruning
    • Guard the retain-count input and only commit/push when pruning actually changes the branch
  • Workflow cleanup

    • Remove the old split-deploy path and its exclude_assets dependency
    • Make prune-step failure modes explicit so bad branch state surfaces as a workflow error instead of silently skewing retention
- name: Stage demo deployment
  run: |
    SHORT_SHA="${{ steps.sha.outputs.short }}"
    mkdir -p "staging/demo/build/${SHORT_SHA}" "staging/demo/build/latest"
    cp index.html "staging/demo/build/${SHORT_SHA}/index.html"
    cp hra.jsdos "staging/demo/build/${SHORT_SHA}/hra.jsdos"
    cp latest-redirect/index.html "staging/demo/build/latest/index.html"

- name: Deploy demo to gh-pages
  uses: peaceiris/actions-gh-pages@v4
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./staging/demo/build
    destination_dir: demo/build
    keep_files: true

Copilot AI and others added 10 commits May 7, 2026 08:58
Agent-Logs-Url: https://github.com/luke-b/DosTest/sessions/fda21b29-1113-4626-a501-9f33822dfc4e

Co-authored-by: luke-b <1448891+luke-b@users.noreply.github.com>
Agent-Logs-Url: https://github.com/luke-b/DosTest/sessions/fda21b29-1113-4626-a501-9f33822dfc4e

Co-authored-by: luke-b <1448891+luke-b@users.noreply.github.com>
Agent-Logs-Url: https://github.com/luke-b/DosTest/sessions/fda21b29-1113-4626-a501-9f33822dfc4e

Co-authored-by: luke-b <1448891+luke-b@users.noreply.github.com>
Agent-Logs-Url: https://github.com/luke-b/DosTest/sessions/fda21b29-1113-4626-a501-9f33822dfc4e

Co-authored-by: luke-b <1448891+luke-b@users.noreply.github.com>
@luke-b
luke-b marked this pull request as ready for review May 7, 2026 09:30
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@luke-b
luke-b merged commit ae9b0eb into main May 7, 2026
8 checks passed
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.

2 participants