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

revert

parent e5664cd1
No related branches found
No related tags found
1 merge request!10merge for publish
Pipeline #245067 passed
......@@ -10,6 +10,8 @@ variables:
build-page:
stage: build
variables:
JEKYLL_ENV: production
before_script:
- gem install bundler
- bundle install
......@@ -18,15 +20,12 @@ build-page:
- chmod +x ./build-page.sh
script:
- |
if [ "$CI_COMMIT_BRANCH" == "publish" ]; then
echo "Running production build for publish branch"
./build-page.sh "/" "_config.yml"
elif [ "$CI_COMMIT_BRANCH" == "main" ]; then
echo "Running draft build for main branch"
./build-page.sh "/draft" "_config_draft.yml"
if [ "$CI_COMMIT_BRANCH" == "publish" ] || [ "$CI_COMMIT_BRANCH" == "main" ]; then
echo "Running on branch $CI_COMMIT_BRANCH"
./build-page.sh "/" true
else
echo "Branch $CI_COMMIT_BRANCH is not configured for building."
exit 1
echo "Running on other branches"
./build-page.sh /draft false
fi
artifacts:
paths:
......@@ -43,7 +42,7 @@ deploy-draft:
- |
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy-draft \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: YOUR_TOKEN_HERE" \
-H "X-Gitlab-Token: glpat-sQ82fiSMo1kCi2TpgSfr" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
......@@ -65,7 +64,7 @@ deploy-production:
- |
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: YOUR_TOKEN_HERE" \
-H "X-Gitlab-Token: glpat-sQ82fiSMo1kCi2TpgSfr" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
......
#!/bin/bash
PAGE_ROOT=${1:-"/"}
CONFIG_FILE=${2:-"_config.yml"}
IS_PUBLISH_DEPLOYMENT=${2:-false}
PAGE_ROOT=$(echo "$PAGE_ROOT" | sed 's:/*$::')
echo "Using configuration file: $CONFIG_FILE"
echo "Publishing to page root: \"$PAGE_ROOT\""
if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then
echo "Using publish deployment strategy"
# Remove the baner which identifies the book as a draft
if ! command -v yq &>/dev/null; then
echo "yq could not be found, the draft banner cannot be removed"
echo "Please install yq (with APT or via https://github.com/mikefarah/yq#install) and try again"
else
cp _config.yml _config.yml.bak
yq -i '.is_draft = false' _config.yml
fi
else
echo "Using draft deployment strategy"
fi
# Execute the Jekyll build command with the selected config file
bundle exec jekyll build -d public -b "$PAGE_ROOT" --config "$CONFIG_FILE"
echo "Publishing to page root: \"$PAGE_ROOT\""
bundle exec jekyll build -d public -b "$PAGE_ROOT"
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