Januari 18, 2022
Deploy Vercel Using Gitlab CI
Just add this file to your repository:
stages:
- deploy
develop:
stage: deploy
image: dockette/vercel
only:
- develop
script:
- DEPLOYMENT_URL=$(VERCEL_ORG_ID=$VERCEL_ORG_ID VERCEL_PROJECT_ID=$VERCEL_PROJECT_ID vercel --confirm -t $VERCEL_TOKEN --scope $VERCEL_USER)
- vercel alias set $DEPLOYMENT_URL $PREVIEW_URL -t $VERCEL_TOKEN --scope $VERCEL_USER
Configure pipeline variables with the following values:
- VERCEL_ORG_ID: orgId from project.json.
- VERCEL_PROJECT_ID: projectId from project.json.
- VERCEL_USER: use your username if you use it as personal or use your team name if you use it as a team.
- VERCEL_TOKEN: generated token from Vercel Settings.
- PREVIEW_URL: domain where you want to bind the deployment with.