Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreytse committed Mar 28, 2024
1 parent b4edbc7 commit 2cb5d05
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ inputs:
cname:
description: 'The cname to use for the site'
required: false
ruby_ver:
description: 'The Ruby version'
required: false
bundler_ver:
description: 'The Bundler version'
required: false
Expand Down
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SSH_PRIVATE_KEY=${INPUT_SSH_PRIVATE_KEY:=}
ACTOR=${INPUT_ACTOR}
REPOSITORY=${INPUT_REPOSITORY}
BRANCH=${INPUT_BRANCH}
RUBY_VER=${INPUT_RUBY_VER:=3.0.6-1}
BUNDLER_VER=${INPUT_BUNDLER_VER:=~>2.4.0}
JEKYLL_SRC=${INPUT_JEKYLL_SRC:=./}
JEKYLL_CFG=${INPUT_JEKYLL_CFG:=./_config.yml}
Expand Down
26 changes: 23 additions & 3 deletions script/init_environment.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# Generate a default secret key
# To prevent archlinux-keyring from no secret key available to sign with
pacman-key --init

# Update packages database
pacman -Syu --noconfirm

Expand All @@ -11,11 +15,27 @@ if [[ -n "${SSH_PRIVATE_KEY}" ]]; then
pacman -S --noconfirm openssh
fi


# Installing ruby libraries
pacman -S --noconfirm ruby2.7 ruby-bundler
case "${RUBY_VERSION}" in
2.7)
pacman -S --noconfirm ruby2.7

# Setting default ruby version
cp /usr/bin/ruby-2.7 /usr/bin/ruby
;;
3*)
# https://gitlab.archlinux.org/archlinux/packaging/packages/ruby/-/tags
pacman -S --noconfirm ruby-${RUBY_VERSION}

# Fix warning: You don't have ./ruby/3.0.0/bin in your PATH,
# gem executables will not run
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"
;;
esac

# Setting default ruby version
cp /usr/bin/ruby-2.7 /usr/bin/ruby
pacman -S --noconfirm ruby-bundler

# debug
ruby -v && bundle version
Expand Down

0 comments on commit 2cb5d05

Please sign in to comment.