Deploy to Vercel
Vercel features built-in CI/CD that can build Turborepo applications with near-zero configuration. To show you how this works, we can deploy two applications to Vercel in under 5 minutes without ever leaving the command line!
Prerequisites
- Vercel CLI
- A Vercel account (If you don't have one yet, you'll be prompted to create one when you run the CLI for the first time.)
- GitHub CLI (Recommended if you don't want to leave your terminal.)
- A GitHub account
Create a new Turborepo
For demo purposes, let's use the Turborepo starter.
Create a repository on GitHub
In your new repository, make sure you have a remote to commit your code to.
Link your repository to Vercel
Now that your local repository has a remote on GitHub, you can create projects on Vercel that are connected to your remote using Vercel CLI.
This command will create a new file at the root of your repository at .vercel/repo.json
where you'll find a mapping of your applications to Vercel projects.
Ship!
You're ready to go! Time to ship your applications.
To ship your docs
app:
To ship your web
app:
You've now shipped two preview deployments from one monorepo. You could also choose to run vercel --prod
to ship to production.
Vercel will use your Vercel Remote Cache with zero-configuration. Through workspace-level caching, you'll always be shipping as fast as possible.
Iterate!
To get your local machine hooked up to your Vercel Remote Cache, run two quick commands:
You'll now be sharing tasks across machines, never duplicating work across your local and CI machines.
As you continue building, you can push code to GitHub on branches and pull requests to create new preview deployments and ship code to production. You can also create one-off preview deployments using vercel
in your terminal to ship your current changes to a Preview Deploy whenever you'd like.