Skip to Content
Release process

Release process

Only a tagged release reaches production. Merging to main deploys staging.

PR (conventional commits) -> Check PR -> merge to main -> staging -> release PR merged -> vX.Y.Z tag + GitHub Release -> production branch -> production

Staging and production

  • Pull requests run Check PR (see Quality gates). Vercel creates no deployment for pull request branches: git.deploymentEnabled in vercel.json allows only production, main and branches named preview/* (the docs project allows only production). I do it this way to keep the Hobby plan’s daily deployment limit free for releases. To get a preview, add the Deploy Preview label to the pull request (see Opt-in previews), or push the branch under a preview/ name, for example git push origin my-branch:preview/my-branch.
  • Merging to main deploys staging at staging.antmejia.com. Staging serves noindex metadata through NEXT_PUBLIC_APP_ENV=staging. Staging and Storybook skip the build when every file changed since the last deployment is documentation or repo tooling (docs/, docs-site/, .github/, root *.md and similar), and for release commits, because production builds the same commit right after (scripts/deploy/vercel-ignore.sh). production always builds.
  • Production is the production branch, and Vercel builds it as the production deployment at antmejia.com. Only tagged releases reach it.

Opt-in previews

Vercel’s Git integration reads branch names, not pull request labels, so the label is handled by .github/workflows/preview-deploy.yml, which deploys with the Vercel CLI. I did not re-enable Git previews and skip builds by label, because an earlier investigation found that ignored builds still consume deployment records.

  • Opt in: add the Deploy Preview label (exact case) to an open, non-draft pull request from a branch in this repository. The workflow waits for the Check commits, types, lint & build check on the same commit, then runs vercel pull, build and deploy --prebuilt for the Preview environment and posts one comment with the URL and short SHA. Each push redeploys while the label stays; reapplying the label redeploys on demand. The comment is edited in place, and it is only updated if the pull request head is still the commit that was built.
  • Skips: forks (the workflow runs with secrets), drafts, failed or missing CI and missing secrets deploy nothing. Failed CI and missing secrets get an explanatory comment. Forks and Dependabot runs have a read-only token and no secrets, so they get no comment; the reason is in the run’s job summary.
  • Unlabel or close: no further builds start and the comment says so. Earlier preview deployments are not deleted; they stay reachable until Vercel expires them. Production, its aliases and staging are never touched, and the workflow never passes the production flag.
  • Scope: the site only. Storybook and the docs project have no pull request preview.
  • Quota: unlabeled pull requests never reach a deploy step, so they create no deployment record. Each labeled push is one deployment and one workflow run of CI-length build time. The preview/* push above still works as a fallback.
  • Setup: add repository secrets VERCEL_TOKEN, VERCEL_ORG_ID and VERCEL_PROJECT_ID (the site project’s ID, from .vercel/project.json after vercel link), and create the Deploy Preview label. Preview environment variables apply as for any Preview build; NEXT_PUBLIC_APP_ENV=staging is scoped to main, so label previews do not get it. Deployment protection on the project decides who can open the URL.
  • Troubleshooting: read the Preview Deploy run on the pull request. A comment reading “No preview deployed” gives the reason.

Docs site and search engines

This docs site is a separate Vercel project, built from the production branch. Its robots.txt and page metadata come from one rule in docs-site/lib/crawl-policy.mjs. On a production deployment, crawlers may visit everything except /_pagefind/ (the search index). Any other build, such as a preview or a local one, disallows all crawling and sets noindex, nofollow on every page. I have not added a sitemap.

Releases

Release Please (.github/workflows/release-please.yml) keeps one release pull request open on main. It reads the conventional commits since the last release, bumps package.json, and updates CHANGELOG.md:

  • feat produces a minor version, fix a patch, and feat! or a BREAKING CHANGE footer a major one.
  • Types such as chore, docs, test, style, refactor, build and ci are hidden from the changelog.

Merging the release pull request creates the vX.Y.Z tag and a GitHub Release. In the same workflow run, the Promote to Production workflow (.github/workflows/promote-production.yml) fast-forwards the production branch to that tag. It runs in the same run because events created with the default GITHUB_TOKEN do not start other workflows.

If a RELEASE_PLEASE_TOKEN secret (a fine-grained personal access token) exists, release-please uses it, and CI then also runs on the release pull request. Without it, the release pull request works, but CI does not run on it.

How I roll back

In GitHub: Actions, then Promote to Production, then Run workflow. Enter an older tag, for example v1.0.0, and tick force. Production is rebuilt from that tag. To go forward again, run it with the newer tag, or merge the next release pull request.

Promoting a previous deployment in the Vercel dashboard is a faster, temporary alternative.

Release readiness

The release-readiness skill (.claude/skills/release-readiness/) answers whether a release is safe to ship. scripts/release-readiness/matrix.mjs reads the path filters and job names from ci.yml and the skip pattern from vercel-ignore.sh, then gives every check one of four results: pass, fail, not-run or unknown. CI here runs on pull requests, so for a release it reads the checks on each merged PR’s head commit. A skipped job, a missing run, a commit made straight to main and CI data it could not fetch all count as unknown, and an unknown required result makes the verdict no-go.

node scripts/release-readiness/matrix.mjs --pr 123 # a release PR: what it would ship node scripts/release-readiness/matrix.mjs --base v1.12.0 --head origin/main node scripts/release-readiness/smoke.mjs --base https://staging.antmejia.com --env staging

smoke.mjs makes GET requests only and checks the title, indexing rules, robots.txt, the sitemap’s origin, 404 behavior, security headers and that the blog index, feed and sitemap agree. It fails a production site that sends noindex and a staging site that does not. Neither script merges, promotes or changes a setting. The skill prepares a rollback and I run it, with the tag named.

Settings this depends on

  • Vercel project: Production Branch set to production, the staging.antmejia.com domain tracking the main branch, and a Preview environment variable NEXT_PUBLIC_APP_ENV=staging for the main branch.
  • GitHub: Settings, Actions, Allow GitHub Actions to create and approve pull requests turned on.

The repository README keeps a shorter version of this page.

Last updated on