Link your GitLab account with your personal account or team on Vercel from your dashboard by clicking "Import Project" followed by "From Git Repository". Then, click the "GitLab" tab and click "Connect with GitLab".
Vercel for GitLab, ready to connect.
Once you have authorized the GitLab integration, you will be redirected back to the "Import Git Repository" page where you can import a project from an existing repository by clicking the "Import Project from GitLab" button under the "GitLab" tab.
Vercel for GitLab will deploy each push by default. This includes pushes and pull requests made to branches. This allows those working within the project to preview the changes made before they are pushed to production.
With each new push, if Vercel is already building a previous commit, the current build will be canceled to build the most recent commit so that you always have the latest changes deployed as quickly as possible.
If Custom Domains are set from a project domains dashboard, pushes and merges to the Production Branch (commonly "main") will be made live to those domains with the latest deployment made with a push.
If you decide to revert a commit that has already been deployed to production, the previous Production Deployment from a commit will automatically be made available at the Custom Domain instantly; providing you with instant rollbacks.
The latest push to any merge request will automatically be made available at a unique preview URL based on the project name, branch, and team or username. These URLs will be provided through a comment on each merge request.
A preview URL created from a merge request.
System Environment Variables
You may want to use different workflows and APIs based on Git information. To support this, the following System Environment Variables can be added to your deployment:
Name
Description
VERCEL_GITLAB_DEPLOYMENT
An indicator for whether the app was deployed by Vercel for GitLab. Example: 1.
VERCEL_GITLAB_PROJECT_NAMESPACE
The GitLab user, group, or sub-group that the project belongs to. Example: Acme.
VERCEL_GITLAB_PROJECT_NAME
The GitLab name of the deployed project. Example: my-site.
VERCEL_GITLAB_PROJECT_ID
The GitLab ID of the deployed project. Example: 13343236.
VERCEL_GITLAB_PROJECT_PATH
The GitLab project path. Example: acme/my-site.
VERCEL_GITLAB_COMMIT_REF
The GitLab branch that the deployment was triggered by. Example: improve-about-page.
VERCEL_GITLAB_COMMIT_SHA
The GitLab sha of the commit the deployment was triggered by. Example: fa1eade47b73733d6312d5abfad33ce9e4068081.
VERCEL_GITLAB_COMMIT_MESSAGE
The message accompanying the GitLab commit that the deployment was triggered by. Example: Add John Doe to about page.
VERCEL_GITLAB_COMMIT_AUTHOR_LOGIN
The username belonging to the author of the commit that was deployed on GitLab. Example: johndoe.
VERCEL_GITLAB_COMMIT_AUTHOR_NAME
The name belonging to the author of the commit that was deployed on GitLab. Example: John Doe.
Disconnect from GitLab
To disconnect your personal account or team on Vercel from GitLab, take the following steps:
First, click here to go to the Applications Settings page on GitLab.
Then, scroll to the bottom of the page and locate Now + GitLab and click the Revoke button next to it.
Revoking access.
After disconnecting, you can always reconnect your Vercel account to a GitLab account again.
Sign up with another GitLab account
To sign up on Vercel with a different GitLab account, sign out of your current GitLab account: