Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.19 KiB
Newer Older
GitLab's avatar
GitLab committed
# 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
GitLab's avatar
GitLab committed

variables:
  GIT_SUBMODULE_STRATEGY: recursive

stages:
  - generate-html
  - generate-pdf

test-html:
  image: registry.gitlab.com/pages/hugo:0.62.2
  stage: generate-html
  tags:
    - lightweight
GitLab's avatar
GitLab committed
  script:
  - DEFAULT_BASEURL=${CI_PAGES_URL##http:} # don't force stuff on plain HTTP when publishing on HTTPS
  - BASEURL=${BASEURL:-$DEFAULT_BASEURL} # set BASEURL in the CI variables to override it
  - echo "Using base URL '$BASEURL'"
  - hugo -b "${BASEURL}"
GitLab's avatar
GitLab committed

.gen-pdf:
  image: docker-registry.apertis.org/apertis/apertis-v2020-documentation-builder
  stage: generate-pdf
  tags:
    - lightweight
GitLab's avatar
GitLab committed
  script:
  - echo "Building PDFs on $(nproc) cores"
  - find public -name "*.pdf-in" -print0 | xargs -0 -r -n1 -P "$(nproc)" scripts/create-pdf
GitLab's avatar
GitLab committed
  artifacts:
    paths:
    - public

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

pages:
  extends: .gen-pdf
GitLab's avatar
GitLab committed
  only:
  - master