Commit 4f71417f authored by ThinhNC's avatar ThinhNC

ci: setup gitlab ci auto deployment to vercel

parent c0bf74fe
Pipeline #53697 failed
......@@ -38,3 +38,6 @@ Thumbs.db
# Production build
www/
.vercel
.env*
stages:
- deploy
default:
image: node:20-alpine
# Tự động deploy Production khi push / merge vào nhánh master
deploy_production:
stage: deploy
only:
- master
before_script:
- npm install -g vercel
script:
- vercel pull --yes --environment=production --token=$VERCEL_TOKEN
- vercel build --prod --token=$VERCEL_TOKEN
- vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN
# Deploy Preview khi push vào nhánh develop hoặc tạo Merge Request
deploy_preview:
stage: deploy
only:
- develop
- merge_requests
before_script:
- npm install -g vercel
script:
- vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
- vercel build --token=$VERCEL_TOKEN
- vercel deploy --prebuilt --token=$VERCEL_TOKEN
{
"outputDirectory": "www",
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment