Skip to content

Deploy only from GitHub's main, through mise run deploy - #8

Merged
gshaw merged 1 commit into
mainfrom
deploy-guard
Sep 29, 2026
Merged

gshaw merged 1 commit into
mainfrom
deploy-guard

Conversation

@gshaw

@gshaw gshaw commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

mise run deploy is now the only way this site ships. The push is the deploy, so it runs scripts/deploy-guard.sh --allow-ahead, then check, then the guard again, then git push origin main. It then waits for the "Cloudflare Pages" check run on the commit (scripts/pages-status.sh --wait, up to 10 minutes) and runs verify. The guard refuses unless the branch is main, the tree is clean (untracked files too) and origin/main isn't ahead. A local main that is ahead is allowed.

  • mise run deploy-status reads the same check run and says whether main is live.
  • verify now has set -e. Before, a multi-line mise task only failed if its last line failed, so a broken home page passed as long as the 404 check did.
  • scripts is in _config.yml's exclude, so Jekyll doesn't publish it. /scripts/deploy-guard.sh is a 404 on the live site.
  • README and AGENTS.md say "deploy with mise run deploy" and link Workshop's deploy note.

Refusals

Tested on merged main in a scratch clone whose origin is a local mirror, so nothing could reach GitHub or Cloudflare:

$ mise run deploy   # on a branch
Deploy refused: on some-branch, not main.
[deploy] ERROR task failed
$ mise run deploy   # an untracked file
Deploy refused: uncommitted or untracked files.
[deploy] ERROR task failed
$ mise run deploy   # behind origin/main
Deploy refused: main is behind origin/main by 1. Pull first.
[deploy] ERROR task failed

After the merge, deploy-status said origin/main (aa0b4ff) is live. and verify passed. No mise run deploy was run for real here.

🤖 Generated with Claude Code

mise run deploy now guards, checks, pushes, waits for Cloudflare Pages
and verifies. deploy-status says whether main is live. verify fails on
any failing line, not just the last.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying birdsnearme-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8a2d70b
Status: ✅  Deploy successful!
Preview URL: https://eacb9ecc.birdsnearme-website.pages.dev
Branch Preview URL: https://deploy-guard.birdsnearme-website.pages.dev

View logs

@gshaw
gshaw merged commit aa0b4ff into main Sep 29, 2026
2 checks passed
@gshaw
gshaw deleted the deploy-guard branch September 29, 2026 19:29
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.

1 participant