Release gated vercel deploy
Skill omaression/company-profile-plugin/skills/release-gated-vercel-deploy
Use when setting up production deployment for a Next.js/Vercel project that must not auto-deploy on every push - release-gated production, manual previews, CI as the single lint/type gate, environment-variable handling, and Dependabot/advisory remediation via overrides.From its SKILL.md
npx -y skills add omaression/company-profile-plugin --skill release-gated-vercel-deployAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.8 KB, as published. Nobody here has run it
Release-gated Vercel deploy
Overview
For a client site you usually do NOT want every push to main to hit production. The shipped model: production deploys only when a GitHub release is published; previews are manual; CI is the single gate that lets anything merge. This makes "go live" an explicit, human, revertible action.
Kill auto-deploy, deploy on release
vercel.json:{ "git": { "deploymentEnabled": false } }disables all git-triggered deploys. Gotcha: Vercel reads this from the pushed commit, not from main, so branches cut before this landed still auto-preview until deleted. Delete pre-gating branches.deploy-production.yml: triggers onrelease: published(plus aworkflow_dispatchbreak-glass), runsnpx vercel deploy --prod. Publishing a GitHub release is the only path to production.deploy-preview.yml:workflow_dispatchonly - previews are deliberate.- Secrets:
VERCEL_ORG_ID,VERCEL_PROJECT_ID, and aVERCEL_TOKENthe user creates and sets (gh secret set VERCEL_TOKEN).
Drafts tag-on-publish: create the GitHub release as a draft, merge the version
bump PR so main reads the new version, THEN publish the release so the deployed
package.json matches the tag.
CI is the single gate
ci.yml runs tsc --noEmit + next lint + vitest + a build + e2e as required
steps. Because CI is authoritative, next build sets
eslint.ignoreDuringBuilds and typescript.ignoreBuildErrors (see
stack-and-architecture). Run the full e2e suite in CI behind a token secret
that skips green on forks. E2E_PROD_SERVER=1 switches Playwright to build +
next start instead of dev. Rebuild before a prod-server e2e run: a dev e2e run
clobbers .next.
Environment variables
- Platform env vars are Sensitive:
vercel env pullreturns empty values. Test secrets via live endpoints, never trust pulled values. NEXT_PUBLIC_*are build-time inlined: changing one needs a redeploy, not just an env edit (e.g. a public captcha site key). Server secrets are runtime.- A worktree without
.env.localbuilds (compiles) but fails at page-data collection (zod env validation). Copy the gitignored.env.localin. - Validate env once with zod in
lib/env.tsand import from there.
Dependency advisories: fix with overrides
When a transitive advisory has no direct bump available, a package.json
overrides entry forcing the patched version is the reliable fix. Lessons:
- Use a global override (
"esbuild": "^0.28.1") when multiple copies across the tree are affected, not a single scoped one. - Some advisories are not reachable in your usage (e.g. an esbuild Deno-install
RCE when you consume esbuild via npm). Note non-reachability, but clearing it
via the same global override also gets
npm auditto zero, which is worth it. - After adding overrides, regenerate the lockfile (
rm package-lock.json node_modules && npm install) so they actually stick;npm install/audit fixcan leave nested copies "invalid". - Closed Dependabot PRs ignore
@dependabot rebase; reopen or hand-make the bump. - Configure Dependabot to ignore semver-major npm updates (majors are deliberate, framework-coupled migrations) but confirm a major-ignore does NOT block security updates.
Verify after a production deploy
Curl the live custom domain (not the alias): all pages 200, 404 returns 404, API routes fail closed (401/4xx without secrets), HSTS + CSP present, canonical
- hreflang point at the real domain. Then resubmit the sitemap in Search Console.