Deploy to Vercel

Teams, Previews and Safe Releases

25 min

Previews as a client workflow

Preview URLs are perfect for agency work: send the client the link for each change, collect feedback (Vercel supports comments on previews), and merge only when approved.

Protect previews that show unreleased work with deployment protection (password or Vercel authentication), and keep them on test data.

Promotion and rollback

  • Production deploys can be instantly rolled back to a previous deployment from the dashboard.
  • You can also promote a specific preview deployment to production after review.

Integrating with CI

Let GitHub Actions run tests and only then allow production deploys:

  • Use branch protection on main so only reviewed, green pull requests merge.
  • Or deploy from CI with the CLI and a token: vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN after vercel build.

Monorepos

Point each Vercel project at its folder (root directory) and use the ignored build step so changing the backend does not redeploy the frontend.

Observability

Use the deployment's runtime logs for function errors, add error tracking (Sentry) to client and server code, and monitor usage so you understand function invocations, bandwidth and image optimisation against plan limits.

Exercise

Set up branch protection with required checks, password-protect previews, promote a reviewed preview to production and practise an instant rollback.

Check yourself

  • Why protect preview deployments?
  • What is the difference between promoting and rolling back?
  • How do you stop unrelated changes from triggering deploys in a monorepo?

Votre progression est enregistrée dans ce navigateur uniquement.

Envoyer pour relecture (10 points)