Skip to content
Snippets Groups Projects
Commit 35347ba2 authored by Kwangjin Lee's avatar Kwangjin Lee
Browse files

Update .gitlab-ci.yml file

parent 299dbce8
No related branches found
No related tags found
1 merge request!10merge for publish
Pipeline #244999 passed
...@@ -20,13 +20,22 @@ build-page: ...@@ -20,13 +20,22 @@ build-page:
script: script:
- | - |
if [[ "$CI_COMMIT_BRANCH" == "main" ]]; then if [[ "$CI_COMMIT_BRANCH" == "main" ]]; then
echo "Building draft site..."
JEKYLL_ENV=production bundle exec jekyll build --config _config_draft.yml --destination public JEKYLL_ENV=production bundle exec jekyll build --config _config_draft.yml --destination public
elif [[ "$CI_COMMIT_BRANCH" == "publish" ]]; then elif [[ "$CI_COMMIT_BRANCH" == "publish" ]]; then
echo "Building production site..."
JEKYLL_ENV=production bundle exec jekyll build --config _config.yml --destination public JEKYLL_ENV=production bundle exec jekyll build --config _config.yml --destination public
else else
echo "Branch is neither main nor publish. Skipping build." echo "Branch is neither main nor publish. Skipping build."
exit 1 exit 1
fi 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:" - echo "Listing contents of public directory:"
- ls -laR public - ls -laR public
artifacts: artifacts:
...@@ -39,8 +48,6 @@ build-page: ...@@ -39,8 +48,6 @@ build-page:
deploy-draft: deploy-draft:
stage: deploy stage: deploy
needs: ["build-page"] needs: ["build-page"]
rules:
- if: $CI_COMMIT_BRANCH == "main"
script: script:
- | - |
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy-draft \ curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy-draft \
...@@ -56,12 +63,12 @@ deploy-draft: ...@@ -56,12 +63,12 @@ deploy-draft:
environment: environment:
name: draft name: draft
url: https://mude.citg.tudelft.nl/2024/draft url: https://mude.citg.tudelft.nl/2024/draft
rules:
- if: $CI_COMMIT_BRANCH == "main"
deploy-production: deploy-production:
stage: deploy stage: deploy
needs: ["build-page"] needs: ["build-page"]
rules:
- if: $CI_COMMIT_BRANCH == "publish"
script: script:
- | - |
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy \ curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy \
...@@ -76,4 +83,6 @@ deploy-production: ...@@ -76,4 +83,6 @@ deploy-production:
}' }'
environment: environment:
name: production name: production
url: https://mude.citg.tudelft.nl/2024 url: https://mude.citg.tudelft.nl/2024
\ No newline at end of file rules:
- if: $CI_COMMIT_BRANCH == "publish"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment