3 # This workflow adds these builds to projects:
6 # Generate a html sphinx-build from the $DOCS_DIRECTORY
9 # Run a non-blocking sphinx-build linkcheck against
13 # Serve the built documentation as the Gitlab Pages site for
16 # Both docs-build and docs-link-check run on merge requests and merges
17 # to the default branch that modify files under the $DOCS_DIRECTORY,
18 # while pages only run on merges.
20 # Scheduled builds can be enabled when creating a schedule job and
21 # specifying DOCS_SCHEDULE = "true" in build variables
23 # If extra dependencies are needed for builds they will be installed
24 # from the $DOCS_REQUIREMENTS location.
27 PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
28 DOCS_DIRECTORY: "docs"
29 DOCS_REQUIREMENTS: "$DOCS_DIRECTORY/requirements.txt"
30 STABLE_BRANCH: "stable/*"
32 .docs-cache: &docs-cache
37 .docs-before-script: &docs-before-script
39 - pip install virtualenv
41 - source venv/bin/activate
44 if [ -f "$DOCS_REQUIREMENTS" ]; then
45 pip install -r "$DOCS_REQUIREMENTS"
54 sphinx-build -T -b html -D language=en $DOCS_DIRECTORY _build/html
60 - if: $CI_PIPELINE_SOURCE == "schedule" && $DOCS_SCHEDULE != "true"
62 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
64 - $DOCS_DIRECTORY/**/*
65 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
66 - if: $CI_COMMIT_BRANCH == $STABLE_BRANCH
76 sphinx-build -T -b linkcheck $DOCS_DIRECTORY _build/linkcheck
82 - if: $CI_PIPELINE_SOURCE == "schedule" && $DOCS_SCHEDULE != "true"
84 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
86 - $DOCS_DIRECTORY/**/*
87 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
88 - if: $CI_COMMIT_BRANCH == $STABLE_BRANCH
95 mv _build/html/* public/
100 - if: $CI_PIPELINE_SOURCE == "schedule"
102 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
104 - $DOCS_DIRECTORY/**/*