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:

Source

  1. https://github.com/vercel/vercel/discussions/4853#discussioncomment-1142946