diff --git a/Dockerfile b/Dockerfile index baeb2462..f833539d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,21 +5,6 @@ LABEL repository="https://github.com/jeffreytse/jekyll-deploy-action" LABEL homepage="https://github.com/jeffreytse/jekyll-deploy-action" LABEL maintainer="Jeffrey Tse " -# Update packages database -RUN pacman -Syu --noconfirm - -# Installing git package -RUN pacman -S --noconfirm git - -# Installing ruby libraries -RUN pacman -S --noconfirm ruby2.7 ruby-bundler - -# Setting default ruby version -RUN cp /usr/bin/ruby-2.7 /usr/bin/ruby - -# debug -RUN ruby -v && bundle version - COPY LICENSE.txt README.md / COPY script /script diff --git a/entrypoint.sh b/entrypoint.sh index 436e7d50..c2145b44 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -40,6 +40,10 @@ if [[ "${PROVIDER}" == "github" ]]; then fi fi +# Initialize environment +echo "Initialize environment" +${SCRIPT_DIR}/script/init_environment.sh + cd ${JEKYLL_SRC} # Check and execute pre_build_commands commands diff --git a/script/init_environment.sh b/script/init_environment.sh new file mode 100755 index 00000000..afa212ce --- /dev/null +++ b/script/init_environment.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Update packages database +pacman -Syu --noconfirm + +# Installing git package +pacman -S --noconfirm git + +# Installing ruby libraries +pacman -S --noconfirm ruby2.7 ruby-bundler + +# Setting default ruby version +cp /usr/bin/ruby-2.7 /usr/bin/ruby + +# debug +ruby -v && bundle version