From 8650507fa6c1fed0bc7acdc89a669f9bd0c056fb Mon Sep 17 00:00:00 2001
From: Kwangjin Lee <k.lee-5@student.tudelft.nl>
Date: Thu, 22 Aug 2024 15:29:41 +0200
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2d1412e..3027709 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,16 +15,19 @@ before_script:
   - bundle config set --local path 'vendor/bundle'
   - bundle install
 
-build:
+build-page:
   stage: build
   script:
     - JEKYLL_ENV=production bundle exec jekyll build --destination public
   artifacts:
     paths:
       - public
+  rules:
+    - if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "publish"
 
 deploy-draft:
   stage: deploy
+  needs: ["build-page"]
   rules:
     - if: $CI_COMMIT_BRANCH == "main"
   script:
@@ -45,6 +48,7 @@ deploy-draft:
 
 deploy-production:
   stage: deploy
+  needs: ["build-page"]
   rules:
     - if: $CI_COMMIT_BRANCH == "publish"
   script:
@@ -61,4 +65,4 @@ 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/website
\ No newline at end of file
-- 
GitLab