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

Update 2 files

- /build-page.sh
- /.gitlab-ci.yml
parent f1054b16
No related branches found
No related tags found
1 merge request!10merge for publish
Pipeline #245063 passed
...@@ -20,13 +20,12 @@ build-page: ...@@ -20,13 +20,12 @@ build-page:
- chmod +x ./build-page.sh - chmod +x ./build-page.sh
script: script:
- | - |
if [ "$CI_COMMIT_BRANCH" == "publish" ] || [ "$CI_COMMIT_BRANCH" == "main" ]; then if [ "$CI_COMMIT_BRANCH" == "publish" ]; then
echo "Running on branch $CI_COMMIT_BRANCH"
./build-page.sh "/" true ./build-page.sh "/" true
else else
echo "Running on other branches" ./build-page.sh "/draft" false
./build-page.sh /draft false
fi fi
artifacts: artifacts:
paths: paths:
- public - public
......
...@@ -7,7 +7,7 @@ PAGE_ROOT=$(echo "$PAGE_ROOT" | sed 's:/*$::') ...@@ -7,7 +7,7 @@ PAGE_ROOT=$(echo "$PAGE_ROOT" | sed 's:/*$::')
if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then
echo "Using publish deployment strategy" echo "Using publish deployment strategy"
# Remove the baner which identifies the book as a draft # Remove the banner which identifies the site as a draft
if ! command -v yq &>/dev/null; then if ! command -v yq &>/dev/null; then
echo "yq could not be found, the draft banner cannot be removed" 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" echo "Please install yq (with APT or via https://github.com/mikefarah/yq#install) and try again"
...@@ -17,7 +17,15 @@ if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then ...@@ -17,7 +17,15 @@ if [ "$IS_PUBLISH_DEPLOYMENT" = true ]; then
fi fi
else else
echo "Using draft deployment strategy" echo "Using draft deployment strategy"
# Ensure the draft flag is true for non-publish deployments
if ! command -v yq &>/dev/null; then
echo "yq could not be found, the draft banner cannot be enforced"
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 = true' _config.yml
fi
fi fi
echo "Publishing to page root: \"$PAGE_ROOT\"" echo "Publishing to page root: \"$PAGE_ROOT\""
bundle exec jekyll build -d public -b "$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