Repository navigation
CD: manual Deploy button on GitHub, alongside automatic deploys - #6
Merged
Merged
Conversation
- .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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
.github/workflows/deploy.yml, Actions → Deploy → Run workflow): pick a branch / tag / commit (defaultmain). It checks CI (check+docker, skippable), registers a queuedproductiondeployment, and waits for ash-cd — the run passes or fails with the deployment.main's head (a rollback) pauses automatic deploys untilmainmoves, so it isn't overwritten 30 s later. Deploymainagain to resume.mainare 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
stagingenvironment:The rehearsal caught a
set -ebug that would have stalled every poll after a manual deploy; fixed. Staging deployments and environment were deleted afterwards; production untouched.🤖 Generated with Claude Code