# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
#image: registry.gitlab.com/pages/hugo:latest

# Locking to v0.62.2 for now - hit by bug, 0.63.2 not available yet with fix:
#   https://github.com/gohugoio/hugo/issues/6805

variables:
  GIT_SUBMODULE_STRATEGY: recursive

stages:
  - generate-html
  - generate-pdf

test-html:
  image: registry.gitlab.com/pages/hugo:0.62.2
  stage: generate-html
  script:
  - hugo
  artifacts:
    paths:
    - public

.gen-pdf:
  image: docker-registry.apertis.org/apertis/apertis-v2020-documentation-builder
  stage: generate-pdf
  script:
  - find public -name "*.pdf-in" -exec scripts/create-pdf {} \;
  needs:
  - job: test-html
  artifacts:
    paths:
    - public

test-pdf:
  extends: .gen-pdf
  except:
  - master

pages:
  extends: .gen-pdf
  only:
  - master
