Skip to content

Commit 608f667

Browse files
committed
feat: better environment initialization
Migrate env initialization from Dockerfile to standalone script, it can improve performance and manipuility.
1 parent 25115dd commit 608f667

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

Dockerfile

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@ LABEL repository="https://github.com/jeffreytse/jekyll-deploy-action"
55
LABEL homepage="https://github.com/jeffreytse/jekyll-deploy-action"
66
LABEL maintainer="Jeffrey Tse <jeffreytse.mail@gmail.com>"
77

8-
# Update packages database
9-
RUN pacman -Syu --noconfirm
10-
11-
# Installing git package
12-
RUN pacman -S --noconfirm git
13-
14-
# Installing ruby libraries
15-
RUN pacman -S --noconfirm ruby2.7 ruby-bundler
16-
17-
# Setting default ruby version
18-
RUN cp /usr/bin/ruby-2.7 /usr/bin/ruby
19-
20-
# debug
21-
RUN ruby -v && bundle version
22-
238
COPY LICENSE.txt README.md /
249

2510
COPY script /script

entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ if [[ "${PROVIDER}" == "github" ]]; then
4040
fi
4141
fi
4242

43+
# Initialize environment
44+
echo "Initialize environment"
45+
${SCRIPT_DIR}/script/init_environment.sh
46+
4347
cd ${JEKYLL_SRC}
4448

4549
# Check and execute pre_build_commands commands

script/init_environment.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Update packages database
4+
pacman -Syu --noconfirm
5+
6+
# Installing git package
7+
pacman -S --noconfirm git
8+
9+
# Installing ruby libraries
10+
pacman -S --noconfirm ruby2.7 ruby-bundler
11+
12+
# Setting default ruby version
13+
cp /usr/bin/ruby-2.7 /usr/bin/ruby
14+
15+
# debug
16+
ruby -v && bundle version

0 commit comments

Comments
 (0)