Repository navigation
Keep automatic Vercel deploys on main only - #186
Merged
Merged
Conversation
Agent branch pushes were building a preview on both Vercel projects and hit the Hobby plan's 100 deployments a day. git.deploymentEnabled now deploys main and skips every other branch before a deployment exists, so a skipped push does not count. A preview is an explicit CLI deploy. Co-authored-by: Gáborjáni-Szabó Ádám <Programcode@users.noreply.github.com>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 18 minutes. View limit details
Note 🎁 Summarized by CodeRabbit Free
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A push to any branch other than
mainno longer starts a Vercel build. Agent and PR branches were creating a preview on bothdebate-navigatoranddebatelab-stagingfor every push, which used up the Hobby plan's 100 deployments a day.Mechanism
vercel.jsonsetsgit.deploymentEnabledto{"main": true, "**": false}.Vercel matches those keys with minimatch. A branch deploys when any matching rule is true, and a branch that matches nothing defaults to true, so the
**rule has to stay.*does not match a/, which would leave branches such ascursor/…deploying.mainmatches both rules and still deploys because one of them is true. Docs: Git configuration.This is not an Ignored Build Step. Vercel creates that deployment before the script runs, and a skip still counts toward the daily cap (why commits do not trigger deployments).
deploymentEnableddecides before a deployment exists, so a skipped push does not count. A commit message such as[preview]cannot turn it back on.What still deploys
Both Vercel projects read this file. Recent production deployments on
debate-navigatoranddebatelab-stagingare frommain. There is no separate staging git branch.debatelab-staging's production site keeps trackingmain(https://debatelab-staging.vercel.app).A branch that does not contain this
vercel.jsonstill deploys on push. After this is onmain, branches cut frommaininherit it.How to request a preview
Only when a real UI change needs a hosted URL. Local
npm run dev:previewandverify-debatelabdo not spend a deployment.From the repo root, with the CLI logged in (
vercel login, orVERCEL_TOKENin the environment; never in the repo):That is one staging-pinned preview. Leave off
--prod. Do not runvercel --yesbefore the link: the first deployment of a new project is production. Linkdebate-navigatorinstead only when the preview has to use production data. One preview is enough.Adam can do the same from the Vercel dashboard: Create Deployment, pick the branch, leave the target as Preview.
Dashboard
No project setting needs to change. Production on both projects already tracks
main, and this file is what turns the other branches off.Verification
npm run verifypassed locally on this commit: docs check, lint, typecheck, unit tests, collaboration tests, edge tests, build, service worker, and 43 desktop Chromium@smoketests. That is a local pass. GitHub Actions were queued when this PR opened; a queued or skipped job is not a CI pass. No production deploy and no Vercel project setting was changed.