From 299dbce816e0713850247b44c35c157edae8c064 Mon Sep 17 00:00:00 2001
From: Kwangjin Lee <k.lee-5@student.tudelft.nl>
Date: Fri, 23 Aug 2024 11:08:43 +0200
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3e08eb5..ee94ac7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,8 +21,11 @@ build-page:
     - |
       if [[ "$CI_COMMIT_BRANCH" == "main" ]]; then
         JEKYLL_ENV=production bundle exec jekyll build --config _config_draft.yml --destination public
-      if [[ "$CI_COMMIT_BRANCH" == "publish" ]]; then
+      elif [[ "$CI_COMMIT_BRANCH" == "publish" ]]; then
         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
     - echo "Listing contents of public directory:"
     - ls -laR public
-- 
GitLab