Skip to content

ci: deploy only after every check passes, and test the live image - #46

Merged
Vishwas1345 merged 3 commits into
mainfrom
ci/gate-deploys-on-checks
Oct 16, 2026
Merged

Vishwas1345 merged 3 commits into
mainfrom
ci/gate-deploys-on-checks

Conversation

@Vishwas1345

Copy link
Copy Markdown
Owner

Why

Nothing stopped a commit that fails CI from going live: Render deployed on every push to main without looking at CI, main has no branch protection, and CI never built deploy/Dockerfile, the image the live site runs.

What

  • render.yaml: autoDeployTrigger: checksPass. Render deploys a commit only after every check on it passes; a failing commit never goes live. Every push to main has at least the detect check, so a commit with zero checks (which Render never deploys) cannot happen.
  • scripts/deploy-image-smoke.sh: builds deploy/Dockerfile, boots it under 512 MB with the demo reset against a throwaway Postgres and Redis, checks login 200, API ok and the 5 security headers, then restarts it and checks the reset. Runs the same on a laptop.
  • changes.yml: a deploy path filter (deploy/**, render.yaml) and a deploy image smoke job that runs when an app or the deploy files change.
  • Docs: DEPLOYMENT, INFRA, ARCHITECTURE, GAPS, QUALITY, SETUP, AGENTS (verification routine step 7b).

Verified

  • The smoke passes locally (both boots, 5 headers, 144 MB).
  • Negative: with start.sh made to exit before migrating, it fails with "the container exited"; restored, no diff.
  • Found and fixed while writing it: docker logs | grep -q under pipefail reports failure on a match (grep exits early, the writer is cut off); output is captured first.
  • lint clean; every link resolves. This PR's own CI runs the new job (deploy files changed).

Still the owner's step

Branch protection on main requiring these checks, so a failing PR cannot be merged either. Until then a failing PR can still be merged; it just never goes live.

🤖 Generated with Claude Code

Vishwas1345 and others added 3 commits October 16, 2026 12:28
CI never built deploy/Dockerfile, the image the live site runs. A new job
runs scripts/deploy-image-smoke.sh whenever an app, deploy/ or render.yaml
changes: build the image, boot it under 512 MB with the demo reset against a
throwaway database, check login, the API and the security headers, then
restart it and check the reset. A deliberately broken boot fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Render deployed on every push to main without looking at CI. With
autoDeployTrigger: checksPass a commit goes live only once all its checks,
the deploy image smoke included, have passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Vishwas1345
Vishwas1345 merged commit dab06b6 into main Oct 16, 2026
5 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.

1 participant