diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 42dfcf539c82952db0e2aa32ade1911eff05a9cf..2b1b3b62c47498fc7c7befafad7916a65ad485ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,17 +14,18 @@ build-page: before_script: - gem install bundler - bundle install - - wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 --no-verbose -O /usr/local/bin/yq - - chmod +x /usr/local/bin/yq - chmod +x ./build-page.sh script: - | - if [ "$CI_COMMIT_BRANCH" == "publish" ] || [ "$CI_COMMIT_BRANCH" == "main" ]; then - echo "Running on branch $CI_COMMIT_BRANCH" + if [ "$CI_COMMIT_BRANCH" == "publish" ]; then + echo "Running on publish branch" ./build-page.sh "/" true + elif [ "$CI_COMMIT_BRANCH" == "main" ]; then + echo "Running on main branch" + ./build-page.sh "/2024/draft" false else echo "Running on other branches" - ./build-page.sh /draft false + ./build-page.sh "/draft" false fi artifacts: paths: diff --git a/_config.yml b/_config.yml index fbeec909c7416f711fcc97e6bc8b693fd016065d..23d90c722f5297dcc198b2fd2869497a55919342 100644 --- a/_config.yml +++ b/_config.yml @@ -99,5 +99,5 @@ compress_html: blanklines: false profile: false -is_draft: true -draft_banner: "This is the DRAFT version of the MUDE 2024 website. Content may change frequently." \ No newline at end of file +# is_draft: true +# draft_banner: "This is the DRAFT version of the MUDE 2024 website. Content may change frequently." \ No newline at end of file diff --git a/build-page.sh b/build-page.sh index a57eaac9837a4e01f619f2dd98152cb89cfb9d3e..c083b38a580c474c1e4b1e5cd9b55feb82f53b73 100644 --- a/build-page.sh +++ b/build-page.sh @@ -7,25 +7,18 @@ PAGE_ROOT=$(echo "$PAGE_ROOT" | sed 's:/*$::') if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then echo "Using publish deployment strategy" - # Remove the banner 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 + CONFIG_FILE="_config.yml" else echo "Using draft deployment strategy" - # Set is_draft to true for draft deployments - yq -i '.is_draft = true' _config.yml + CONFIG_FILE="_config_draft.yml" fi -echo "Config file contents after modification:" -cat _config.yml +echo "Using config file: $CONFIG_FILE" +echo "Config file contents:" +cat "$CONFIG_FILE" echo "Publishing to page root: \"$PAGE_ROOT\"" -bundle exec jekyll build -d public -b "$PAGE_ROOT" --config _config.yml +bundle exec jekyll build -d public -b "$PAGE_ROOT" --config "$CONFIG_FILE" echo "Build complete. Contents of public directory:" ls -R public \ No newline at end of file