Skip to content

Deploy: update the standby copy of the site on every push to main, also while production is down - #103

Merged
CristhianKapelinski merged 1 commit into
mainfrom
deploy/standby-runner
Nov 23, 2026
Merged

CristhianKapelinski merged 1 commit into
mainfrom
deploy/standby-runner

Conversation

@CristhianKapelinski

Copy link
Copy Markdown
Member

The standby copy of anonshield.org only copied the images that production was running, every 10 minutes. With production down since 11/11, the standby is serving the site and is stuck on f272f94: #102 (the security updates) was built and published but never reached the site, because the deploy job waits for the production runner.

This adds a second deploy job, "Deploy to standby", on its own self-hosted runner on the standby host:

  • web/deploy-standby.sh <commit> pulls the backend and frontend images of the commit from GHCR (with the job's GITHUB_TOKEN, no personal token on the host), copies docker-compose.a10.yml and Caddyfile.a10, writes the tag into the standby's .env and recreates the azul copy. If the new copy does not report the commit on /api/health in 5 minutes, it goes back to the previous .env and files.
  • When the failover Worker says the standby serves the site, the job also checks that https://anonshield.org/api/health reports the commit.
  • It removes this app's previous images, like the production job.
  • The runner has only the label anonshield-standby (no default labels, not even self-hosted), so no other job can land on it. Fork PRs from outside contributors now need approval before any workflow runs.

There is no second copy to swap with on the standby, so while it serves, the site is down for as long as the backend takes to start. The production job is unchanged.

RUNBOOK: new "Standby copy" section.

@CristhianKapelinski
CristhianKapelinski merged commit e5ece35 into main Nov 23, 2026
13 checks passed
@CristhianKapelinski
CristhianKapelinski deleted the deploy/standby-runner branch November 23, 2026 03:15
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