diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee94ac7247e5291ceeda2a82ab987055bd0315b2..97cc55a169cf6e42f9f7b99094ca9a3ba0e885db 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"