Deploying to Vercel
Learn how to create deployments on Vercel using Git, Vercel CLI, Deploy Hooks, and Vercel REST API.A Vercel deployment is the result of a successful build of your project. You can trigger a deployment on Vercel using one of the following methods:
The most common way to create a deployment on Vercel is through pushing code to Git repositories.
Creating an automatic deployment begins by importing a Git repository on Vercel. This repository can either be private or public. To setup a Git repository, click the New Project button from the Vercel dashboard and select one of the following Git providers:
Deploying your application using Vercel's Git integration gives you:
- Simplified collaboration through pull requests or merge requests
- The ability to test new features and changes using automatically generated Preview deployments before merging to the
main
branch to automatically create a production deployment - The ability to receive live feedback in preview environments with the Comments feature (on supported Git providers).
You can also create deployments from a Git reference directly from the Vercel Dashboard. This is useful when you need to deploy specific commits or the latest changes from a branch, especially during times when automatic deployments might be disrupted.
Learn more with our Deploying a Git repository guide.
If you want to initiate deployments based on external events in your Git repo, you can use Deploy Hooks.
Vercel CLI allows you to deploy your Projects directly from the Command Line Interface (CLI). To learn more, see Deploying to Vercel with Vercel CLI.
Deploy Hooks are another way of creating deployments on Vercel. However, a connection to a Git repository is still necessary in order to use Deploy Hooks.
The Deploy Hooks method is useful when the changes in an application depend on external events. If these changes are related to content and are made directly in a Headless Content Management System (CMS) or database, you may want to trigger deployments without touching code. For example, you may want to trigger a deployment when a new blog post is published or when an existing blog post is updated.
To use this deployment method, you have to generate a URL that accepts HTTP GET
or POST
requests to trigger deployments and re-run the Build Step without needing to push a new git commit. The URL generated is unique for every project.
See the Deploy Hooks documentation for more information.
The Vercel REST API is used to create deployments by making an HTTP POST
request to the relevant endpoint. The request's body will include all the files you want to deploy. You will have to generate a SHA
for each file and upload using the Vercel REST API.
This deployment method is helpful for projects that use a custom workflow and add custom domains to a multi-tenant application or integrate a third-party service that is not currently supported by the Vercel platform.
Find more information about the Vercel REST API endpoint in the API reference.
Was this helpful?