From b52e3a30c360a37455f2237d070504a2857fd931 Mon Sep 17 00:00:00 2001 From: Kwangjin Lee <k.lee-5@student.tudelft.nl> Date: Fri, 23 Aug 2024 11:27:50 +0200 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee94ac7..97cc55a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,13 +20,22 @@ build-page: script: - | if [[ "$CI_COMMIT_BRANCH" == "main" ]]; then + echo "Building draft site..." JEKYLL_ENV=production bundle exec jekyll build --config _config_draft.yml --destination public elif [[ "$CI_COMMIT_BRANCH" == "publish" ]]; then + echo "Building production site..." JEKYLL_ENV=production bundle exec jekyll build --config _config.yml --destination public else echo "Branch is neither main nor publish. Skipping build." exit 1 fi + - cp _config.yml public/ + - cp -R _includes public/ + - cp -R _layouts public/ + - cp -R _sass public/ + - cp -R assets public/ + - cp Gemfile public/ + - cp Gemfile.lock public/ - echo "Listing contents of public directory:" - ls -laR public artifacts: @@ -39,8 +48,6 @@ build-page: deploy-draft: stage: deploy needs: ["build-page"] - rules: - - if: $CI_COMMIT_BRANCH == "main" script: - | curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy-draft \ @@ -56,12 +63,12 @@ deploy-draft: environment: name: draft url: https://mude.citg.tudelft.nl/2024/draft + rules: + - if: $CI_COMMIT_BRANCH == "main" deploy-production: stage: deploy needs: ["build-page"] - rules: - - if: $CI_COMMIT_BRANCH == "publish" script: - | curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy \ @@ -76,4 +83,6 @@ deploy-production: }' environment: name: production - url: https://mude.citg.tudelft.nl/2024 \ No newline at end of file + url: https://mude.citg.tudelft.nl/2024 + rules: + - if: $CI_COMMIT_BRANCH == "publish" -- GitLab