+# Generic rule to not run the job during scheduled pipelines
+# ----------------------------------------------------------
+.scheduled_pipelines-rules:
+ rules: &ignore_scheduled_pipelines
+ if: '$CI_PIPELINE_SOURCE == "schedule"'
+ when: never
+
+.docs-base:
+ extends: .ci-run-policy
+ image: alpine
+ script:
+ - apk --no-cache add py3-pip graphviz
+ - pip3 install sphinx sphinx_rtd_theme
+ - sphinx-build -b html docs public
+
+pages:
+ extends: .docs-base
+ stage: deploy
+ artifacts:
+ paths:
+ - public
+ rules:
+ - *ignore_scheduled_pipelines
+ - if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"'
+ changes: &docs-or-ci
+ - docs/**/*
+ - .gitlab-ci.yml
+ when: always
+ # Other cases default to never
+
+test-docs:
+ extends: .docs-base
+ # Cancel job if a newer commit is pushed to the same branch
+ interruptible: true
+ stage: container+docs
+ rules:
+ - *ignore_scheduled_pipelines
+ - if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
+ changes: *docs-or-ci
+ when: on_success
+ - if: '$GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME && $CI_PROJECT_PATH == "mesa/mesa"'
+ changes: *docs-or-ci
+ when: on_success
+ - if: '$CI_PROJECT_PATH != "mesa/mesa" || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
+ changes: *docs-or-ci
+ when: manual
+ # Other cases default to never