Skip to content

CD: manual Deploy button on GitHub, alongside automatic deploys - #6

Merged
Arismemo merged 1 commit into
mainfrom
deploy-button
Sep 25, 2026
Merged

Arismemo merged 1 commit into
mainfrom
deploy-button

Conversation

@Arismemo

Copy link
Copy Markdown
Owner

What

  • Deploy button (.github/workflows/deploy.yml, Actions → Deploy → Run workflow): pick a branch / tag / commit (default main). It checks CI (check + docker, skippable), registers a queued production deployment, and waits for ash-cd — the run passes or fails with the deployment.
  • ash-cd now polls every 30 s. Manual requests take priority over automatic deploys; newest request wins, older ones are marked superseded.
  • Deploying something that isn't main's head (a rollback) pauses automatic deploys until main moves, so it isn't overwritten 30 s later. Deploy main again to resume.
  • Automatic deploys of CI-green main are unchanged.

Why still pull-based

The workflow runs on GitHub-hosted runners and only talks to the GitHub API; the server keeps pulling. No self-hosted runner, no inbound access, no server credentials in GitHub.

Verified

Rehearsed on a staging container with a copy of production data and GitHub's staging environment:

  • manual deploy of an older commit → success, automatic deploys paused
  • two queued requests → newest deployed, older marked superseded, pause released
  • request for a commit without green CI → rejected
  • request for the live version → immediate success

The rehearsal caught a set -e bug that would have stalled every poll after a manual deploy; fixed. Staging deployments and environment were deleted afterwards; production untouched.

🤖 Generated with Claude Code

- .github/workflows/deploy.yml (workflow_dispatch): resolves the ref,
  requires green check + docker (unless skip_ci_check), registers a
  queued production deployment and waits for ash-cd to report back —
  the run's result is the deployment's result. Runs on GitHub-hosted
  runners; the server still only pulls.
- ash-cd polls every 30 s; queued manual requests take priority over
  automatic deploys; only the newest of several is deployed, the rest
  are marked superseded; already-live targets succeed immediately.
- Deploying something other than main's head (e.g. a rollback) pauses
  automatic deploys until main gets a new commit, so it is not
  overwritten 30 s later. Failed / rolled-back / paused commits share
  one skip marker with a reason, shown by `ash-cd status`.
- ASH_CD_GH_ENV lets rehearsals use a separate GitHub environment.

Rehearsed on a staging container against GitHub's "staging" environment:
manual rollback + pause, two queued requests (newest wins, older
superseded, pause released), CI-red request rejected, already-live
request. The rehearsal also caught queued_requests failing under
set -e when the last recent deployment wasn't queued, which would have
stalled every poll; fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Arismemo
Arismemo merged commit 5b15d99 into main Sep 25, 2026
2 checks passed
@Arismemo
Arismemo deleted the deploy-button branch September 25, 2026 08:04
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