I have a project that has the following environment setup:
Production - main branch gets deployed on push
Staging (custom environment) - staging branch gets deployed on push
Preview - branch tracking disabled, no preview deployments
We have preview deployments disabled due to our unique database structure which doesn’t allow for database branching via Vercel. We plan to work around this by using GitHub CI instead of Vercel CI, but that’s later down the road.
The problem is that whenever I have a pull request on a branch that’s not main or staging, the Vercel bot marks the deploy as failed with the error Preview deployments are disabled for this project.
This is fine, but it’s kind of annoying to see checks failing when deployment shouldn’t even be a check:
Enables deployments only for the main and staging branches
Implicitly disables deployments for all other branches
Keeps the GitHub integration enabled but silences the deployment status checks
By only specifying main and staging in the deploymentEnabled object, Vercel automatically disables deployments for all other branches.
The "silent": true setting in the GitHub configuration prevents Vercel from creating status checks for deployments, which should resolve the issue of seeing failed checks in your pull requests.
The configuration will prevent the “Preview deployments are disabled for this project” error from appearing as a failed check in your GitHub pull requests.
You can also manage these settings through the Vercel dashboard:
Go to your project settings
Navigate to the Git section
Under “Production Branch”, set it to “main”
Under “Custom Domains”, ensure your staging branch is properly configured
Under “Preview Deployments”, you can disable them entirely if you prefer a UI approach