Skip to content

Commit

Permalink
feat: add input for custom jekyll baseurl
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreytse committed Aug 31, 2020
1 parent 6ce3cc9 commit 31bfaaa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ inputs:
jekyll_cfg:
description: 'The Jekyll website config files'
required: false
jekyll_baseurl:
description: 'The Jekyll website baseurl'
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
12 changes: 9 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BRANCH=${INPUT_BRANCH:=gh-pages}
BUNDLER_VER=${INPUT_BUNDLER_VER:=>=0}
JEKYLL_SRC=${INPUT_JEKYLL_SRC:=./}
JEKYLL_CFG=${INPUT_JEKYLL_CFG:=./_config.yml}
JEKYLL_BASEURL=${INPUT_JEKYLL_BASEURL:=}

echo "Starting the Jekyll Deploy Action"

Expand All @@ -32,13 +33,18 @@ echo "Starting bundle install"
bundle config path ${WORKING_DIR}/vendor/bundle
bundle install

# Pre-handle Jekyll baseurl
if [ -n "${JEKYLL_BASEURL-}" ]; then
JEKYLL_BASEURL="--baseurl ${JEKYLL_BASEURL}"
fi

echo "Starting jekyll build"
JEKYLL_ENV=production bundle exec jekyll build \
-s ${JEKYLL_SRC} \
${JEKYLL_BASEURL} \
-c ${JEKYLL_CFG} \
-d build
-d ${WORKING_DIR}/build

cd build
cd ${WORKING_DIR}/build

# Check if deploy on the same repository branch
if [[ "${PROVIDER}" == "github" ]]; then
Expand Down

0 comments on commit 31bfaaa

Please sign in to comment.