Skip to content

Commit

Permalink
feat: support to execute pre-build commands
Browse files Browse the repository at this point in the history
As we known, some libraries are required to be installed when we
use some gems, this feature make it possible.
  • Loading branch information
jeffreytse committed Aug 19, 2021
1 parent 59b1905 commit 25115dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ inputs:
jekyll_baseurl:
description: 'The Jekyll website baseurl'
required: false
pre_build_commands:
description: 'The pre-build commands'
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ BUNDLER_VER=${INPUT_BUNDLER_VER:=>=0}
JEKYLL_SRC=${INPUT_JEKYLL_SRC:=./}
JEKYLL_CFG=${INPUT_JEKYLL_CFG:=./_config.yml}
JEKYLL_BASEURL=${INPUT_JEKYLL_BASEURL:=}
PRE_BUILD_COMMANDS=${INPUT_PRE_BUILD_COMMANDS:=}

# Set default bundle path and cache
BUNDLE_PATH=${WORKING_DIR}/vendor/bundle
Expand All @@ -41,6 +42,12 @@ fi

cd ${JEKYLL_SRC}

# Check and execute pre_build_commands commands
if [[ ${PRE_BUILD_COMMANDS} ]]; then
echo "Executing pre-build commands"
eval "${PRE_BUILD_COMMANDS}"
fi

echo "Initial comptible bundler"
${SCRIPT_DIR}/script/cleanup_bundler.sh
gem install bundler -v "${BUNDLER_VER}"
Expand Down

0 comments on commit 25115dd

Please sign in to comment.