Production Deployments — Backend
Manage Convex backend deployments using release-please and GitHub Actions.
YeetCode uses release-please to automate versioning and changelogs, combined with GitHub Actions to deploy the Convex backend to production when a new version is tagged.
How It Works
The deployment pipeline has two stages:
- release-please watches commits on
mainand opens a release PR that bumps the version, updatesCHANGELOG.md, and updatespackage.json - When the release PR is merged, a git tag is created (e.g.
convex-backend@v1.4.0), which triggers the deploy workflow
commit to main → release-please PR → merge → tag created → deploy workflow runsTag Format
Tags follow the pattern convex-backend@v{version} (e.g. convex-backend@v1.3.0). This is configured in release-please-config.json:
{
"include-component-in-tag": true,
"include-v-in-tag": true,
"tag-separator": "@",
"separate-pull-requests": true,
"packages": {
"apps/convex-backend": {
"release-type": "node",
"changelog-path": "CHANGELOG.md",
"component": "convex-backend"
}
}
}Production Deploy Workflow
The workflow at .github/workflows/deploy-backend.yaml triggers on convex-backend@v* tags and runs bunx convex deploy:
on:
push:
tags:
- convex-backend@v*
jobs:
deploy-convex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bunx convex deploy
working-directory: apps/convex-backend
env:
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY_PRODUCTION }}Setup Steps
1. Get Your Convex Deploy Keys
You need deploy keys for both your production and test Convex projects.
- Go to dashboard.convex.dev
- Select your production project → Settings → Deploy Key → copy it
- Select your test/dev project → Settings → Deploy Key → copy it
2. Add GitHub Secrets
In your GitHub repo, go to Settings → Secrets and variables → Actions and add:
| Secret | Description |
|---|---|
CONVEX_DEPLOY_KEY_PRODUCTION | Deploy key for your production Convex project |
MY_RELEASE_PLEASE_TOKEN | GitHub PAT with repo + pull-requests permissions |
3. Create the Release-Please Token
release-please needs a GitHub Personal Access Token (not the default GITHUB_TOKEN) to create release PRs and tags:
- Go to github.com/settings/tokens → Fine-grained tokens
- Create a token scoped to your YeetCode repo with permissions:
- Contents: Read and write
- Pull requests: Read and write
- Save it as
MY_RELEASE_PLEASE_TOKENin your repo secrets
4. Use Conventional Commits
release-please determines version bumps from commit messages. Use the Conventional Commits format:
| Commit prefix | Version bump | Example |
|---|---|---|
fix: | Patch (1.3.0 → 1.3.1) | fix(backend): handle null user in webhook |
feat: | Minor (1.3.0 → 1.4.0) | feat(backend): add Stripe webhook handler |
feat!: or BREAKING CHANGE: | Major (1.3.0 → 2.0.0) | feat!: redesign auth flow |
Commits that don't match a conventional prefix (e.g. chore:, docs:, refactor:) won't trigger a version bump but will still appear in the changelog.
Files Involved
| File | Purpose |
|---|---|
release-please-config.json | Defines which packages release-please manages |
release-please-manifest.json | Tracks the current version of each package (auto-updated) |
.github/workflows/release-please.yaml | Creates release PRs and tags on push to main |
.github/workflows/deploy-backend.yaml | Deploys to production Convex on convex-backend@v* tags |
apps/convex-backend/CHANGELOG.md | Auto-generated changelog |
apps/convex-backend/package.json | Version field auto-updated by release-please |
Deploying Manually
If you need to deploy without going through the release flow:
# Deploy to production (requires CONVEX_DEPLOY_KEY env var)
cd apps/convex-backend
CONVEX_DEPLOY_KEY=your-key bunx convex deploy
# Deploy to dev (uses your local Convex auth)
cd apps/convex-backend
bunx convex deploy