Newer
Older
---
image: ruby:3
variables:
JEKYLL_ENV: production
LC_ALL: en_US.UTF-8
before_script:
- gem install bundler
- bundle install
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
rules:
- if: "$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH"
pages:
stage: deploy
script:
- apt-get update && apt-get -y install yq
- PAGES_PATH=$(echo $CI_PAGES_URL | sed 's;^\(https\?://[^/]\+\)\(/\?.*\);\1;')
- PAGES_BASEURL=$(echo $CI_PAGES_URL | sed 's;^\(https\?://[^/]\+\)\(/\?.*\);\2;')
- yq ".baseurl = \"$PAGES_BASEURL\" | .url = \"$PAGES_PATH\"" _config.yml > _config.yml.1
- mv _config.yml.1 _config.yml
- bundle exec jekyll build -d public
artifacts:
paths:
- public
rules:
- if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"