Update .gitlab-ci.yml file

This commit is contained in:
2025-07-25 20:40:50 +00:00
parent 49069feddd
commit f6042b91f9

View File

@@ -1,5 +1,6 @@
stages:
- build-and-deploy
- build
- deploy
variables:
ZOLA_VERSION: "0.20.0"
@@ -9,8 +10,8 @@ variables:
CUSTOM_DOMAIN: ""
GIT_SUBMODULE_STRATEGY: none
build-and-deploy:
stage: build-and-deploy
build-site:
stage: build
image: ubuntu:latest
rules:
- if: $CI_COMMIT_BRANCH == "main"
@@ -70,9 +71,21 @@ build-and-deploy:
# Copy public folder for GitLab Pages deployment
- cp -r ./template/public .
artifacts:
paths:
- public/
expire_in: 1 week
# GitLab Pages deployment job (required name: "pages")
pages:
stage: deploy
image: alpine:latest
dependencies:
- build-site
script:
# Display deployment information
- |
echo "🚀 Deployment completed!"
echo "🚀 Deploying to GitLab Pages..."
echo ""
if [ -n "$CUSTOM_DOMAIN" ]; then
echo "🌐 Site URLs:"
@@ -91,15 +104,15 @@ build-and-deploy:
echo "💡 To enable custom domain:"
echo " Set CUSTOM_DOMAIN variable in CI/CD settings"
fi
artifacts:
paths:
- public/
expire_in: 1 week
rules:
- if: $CI_COMMIT_BRANCH == "main"
# Optional: Manual domain verification job
verify-domain:
stage: build-and-deploy
stage: deploy
image: ubuntu:latest
script:
- apt-get update -qq && apt-get install -y dnsutils curl