I'm using Vercel for frontend hosting, and I need to trigger two separate preview deployments per pull request, each pointing to a different backend environment.
We run end-to-end (E2E) tests (with Playwright - they are part of the codebase) that require a full Vercel build. However, we don’t want to run these tests against our staging backend to avoid polluting its database with noisy fake data.
So for every PR, we need:
- A Vercel deployment for manual QA, using the staging backend (
BACKEND_API_URL=https://staging-api...) - A separate Vercel deployment for automated E2E tests, using a dedicated test backend (
BACKEND_API_URL=https://e2e-api...)
However, Vercel seems to support only one preview deployment per PR by default. I haven’t found a way to trigger a second one with different env vars.
Is there a way to configure Vercel so that:
- Each PR gets two preview deployments
- Each deployment uses a different
BACKEND_API_URLenv var - Both deployments are triggered automatically on PRs?