Commit 2993f3a4 authored by SaoBien's avatar SaoBien

deploy vercel

parent dea39a22
Pipeline #51884 passed with stage
in 1 minute and 33 seconds
......@@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.vercel
.env*
.env
\ No newline at end of file
stages:
- deploy
deploy_job:
stage: deploy
before_script:
- npm install -g vercel 2>/dev/null
script:
- |
DEPLOY_OUTPUT=$(vercel deploy \
--token=$VERCEL_TOKEN \
--yes \
2>&1)
echo "=== Full output ==="
echo "$DEPLOY_OUTPUT"
# Grep lấy đúng URL dạng https://xxx.vercel.app
DEPLOY_URL=$(echo "$DEPLOY_OUTPUT" | grep -Eo 'https://[a-zA-Z0-9._-]+\.vercel\.app' | head -1)
echo "Deploy URL: $DEPLOY_URL"
if [ -z "$DEPLOY_URL" ]; then
echo "ERROR: Không lấy được deploy URL!"
exit 1
fi
vercel alias set "$DEPLOY_URL" staging-$CI_PROJECT_NAME.vercel.app \
--token=$VERCEL_TOKEN
echo "Staging URL: https://staging-$CI_PROJECT_NAME.vercel.app"
tags:
- runner-vpd-que
only:
- staging
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