From f6042b91f9d4fd2f7b7d9bddca8a1c92aabbb1ff Mon Sep 17 00:00:00 2001 From: Artem Krivopolenov Date: Fri, 25 Jul 2025 20:40:50 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1758819..0eb2b2e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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