cmd / deploy
deploy is a Go CLI that deploys services to Render
from the latest origin/main.
Run from any branch or git worktree:
go run ./cmd/deploy
It requires a RENDER_API_KEY environment variable (loaded from .env).
Flow
- Fetch
origin/mainto get the latest merged commit. - Ensure
sentry-cliis installed and authenticated. - Prompt to check Render status for incidents.
- For each service, compare the live deploy commit to
origin/main. If there are new commits, show the log and prompt to deploy. - After all deploys, create a Sentry release tagged with the deployed SHA.
Example session:
$ go run ./cmd/deploy
From https://github.com/org/repo
* branch main -> FETCH_HEAD
Check https://status.render.com/ for incidents before continuing.
Press any key to continue or ctrl+c to exit...
```
a1b2c3d4e fix session expiry on token refresh
f5e6d7c8b add retry logic to webhook delivery
```
deploy app-jobs? (y/n) y
deploying `app-jobs`...
deployed app-jobs
skipping `app-web`, already up to date...
Services
The script deploys multiple Render services:
app-jobsbackground jobsapp-webweb app
Render API client
The render package (render/client.go) wraps two Render API endpoints:
GET /services/:id/deploys?limit=5— find the live deploy's commit SHAPOST /services/:id/deploys— trigger a deploy at a specific commit
The client retries on 502/503/504 with backoff (1s, 3s, 10s) before giving up.
Sentry release
After deploying, the script creates a Sentry release:
sentry-cli releases new— create a release tagged with the short SHAsentry-cli releases set-commits --auto— associate commitssentry-cli releases deploys new --env production— mark the deploy
This connects Sentry errors to the deploy that introduced them.
Design
The script uses origin/main. This makes it work from any git worktree and
ignores local main commits that haven't been pushed yet.
Each service is deployed independently with a y/n prompt, so you can skip a service if it has unrelated changes or you want to deploy incrementally.