Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
upgrade-data-crawler-fe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ThinhNC
upgrade-data-crawler-fe
Commits
c4f0d6dd
Commit
c4f0d6dd
authored
Sep 10, 2026
by
ThinhNC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ci): update gitlab ci to official vercel pipeline template
parent
d12ffae6
Pipeline
#53073
failed with stage
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
25 deletions
+15
-25
.gitlab-ci.yml
.gitlab-ci.yml
+15
-25
No files found.
.gitlab-ci.yml
View file @
c4f0d6dd
# GitLab CI/CD Pipeline for deploying Next.js to Vercel using Vercel CLI
# Reference: https://vercel.com/kb/guide/how-can-i-use-gitlab-pipelines-with-vercel
# Standard template matching official Vercel documentation:
# https://vercel.com/kb/guide/how-can-i-use-gitlab-pipelines-with-vercel
image
:
node:20
-alpine
image
:
node:20
stages
:
-
deploy
variables
:
PNPM_HOME
:
"
/root/.local/share/pnpm"
PATH
:
"
$PNPM_HOME:$PATH"
before_script
:
-
npm install -g pnpm vercel
-
pnpm config set store-dir .pnpm-store
# Cache pnpm dependencies and Next.js build cache to speed up pipelines
cache
:
key
:
files
:
-
pnpm-lock.yaml
paths
:
-
.pnpm-store
-
.next/cache
# 1. Preview Deployment (Triggered on feature branches and Merge Requests)
# 1. Preview Deployment (Tất cả các nhánh tính năng trừ staging, main)
deploy_preview
:
stage
:
deploy
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
!=
"main"
&&
$CI_COMMIT_BRANCH
!=
"master"'
except
:
-
staging
-
main
before_script
:
-
npm install --global pnpm vercel
script
:
-
vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
-
vercel build --token=$VERCEL_TOKEN
...
...
@@ -36,11 +23,14 @@ deploy_preview:
VERCEL_ORG_ID
:
$VERCEL_ORG_ID
VERCEL_PROJECT_ID
:
$VERCEL_PROJECT_ID
# 2. Production Deployment (
Triggered only when merging into main/master
)
# 2. Production Deployment (
Kích hoạt khi push lên nhánh staging, main
)
deploy_production
:
stage
:
deploy
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
"main"
||
$CI_COMMIT_BRANCH
==
"master"'
only
:
-
staging
-
main
before_script
:
-
npm install --global pnpm vercel
script
:
-
vercel pull --yes --environment=production --token=$VERCEL_TOKEN
-
vercel build --prod --token=$VERCEL_TOKEN
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment