gitlab-ci: Extend .ci-run-policy template for docs jobs

Requires using rules: in the pages job as well, so it doesn't inherit
the rules from the template.

v2:
* Add comment explaining that cases not covered by explicit rules
  default to "when: never".

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5469>
This commit is contained in:
Michel Dänzer 2020-06-22 11:21:06 +02:00 committed by Marge Bot
parent 1c612e8c09
commit 8e2cb8ef27
1 changed files with 9 additions and 9 deletions

View File

@ -25,6 +25,7 @@ stages:
- success
.docs-base:
extends: .ci-run-policy
image: alpine
script:
- apk --no-cache add py3-pip
@ -37,12 +38,13 @@ pages:
artifacts:
paths:
- public
only:
refs:
- master@mesa/mesa
changes:
- docs/**/*
- .gitlab-ci.yml
rules:
- if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"'
changes: &docs-or-ci
- docs/**/*
- .gitlab-ci.yml
when: on_success
# Other cases default to never
test-docs:
extends: .docs-base
@ -51,9 +53,7 @@ test-docs:
- if: '$CI_PROJECT_NAMESPACE == "mesa"'
when: never
- if: '$GITLAB_USER_LOGIN == "marge-bot"'
changes: &docs-or-ci
- docs/**/*
- .gitlab-ci.yml
changes: *docs-or-ci
when: on_success
- changes: *docs-or-ci
when: manual