image: ruby:2.7

variables:
  JEKYLL_ENV: production
  LC_ALL: C.UTF-8

before_script:
  - apt update
  - apt install -y git-lfs
  - bundle install

test:
  stage: test
  script:
  - git lfs checkout
  - bundle exec jekyll build -d test
  artifacts:
    paths:
    - test
  except:
  - master

pages:
  stage: deploy
  script:
  - git lfs checkout
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
    expire_in: 15 mins # latest is always kept (settings/ci/artifacts/Keep artifacts from most recent successful jobs)
  only:
  - master
