0

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:

  1. A Vercel deployment for manual QA, using the staging backend (BACKEND_API_URL=https://staging-api...)
  2. 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_URL env var
  • Both deployments are triggered automatically on PRs?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.