I am working in a Turborepo with 2 apps: api and app. I would like to orchestrate how we build and deploy these apps (PRs, and Prod builds). I’m using Neon, and Inngest, which both have their associated “branching” features.
For all Pull Request builds, I’d like to build the api first, then trigger the web deployment (which will set the NEXT_PUBLIC_API_URL to my preview api build).
For all Prod deployments, I only want to build api if it changed (turbo-ignore comes to mind here), but I still need to wait and trigger web after that processes.
Is this possible with Vercel’s project configuration out of the box, or should I look at using GitHub Actions + Vercel CLI and manage the deployments via a GHA Workflow?
For something with timing dependency like this, I would recommend using Vercel CLI for a custom workflow. That way you can still automate the preview deployments and be sure the right URL is used for the api URL.
The build env and runtime env options will let you override environment variables for that specific deployment. I’ve seen people use them for scenarios similar to what you described.