ci(rules): improve docs related jobs rules

- build_docs_pdf: now ignore docs related file patterns

- deploy_docs_preview: now ignore docs related file patterns

- .rules:build:docs: related jobs will not be triggered with `build` label
This commit is contained in:
Fu Hanxi
2021-02-19 17:28:09 +08:00
parent 2399128500
commit 4c1fca4a77
3 changed files with 24 additions and 16 deletions

View File

@@ -49,15 +49,20 @@
"build:docs": "build:docs":
labels: labels:
- build
- docs - docs
- build_docs # for backward compatibility - build_docs # for backward compatibility
patterns: patterns:
- docs - docs
deploy: deploy:
- preview
- production - production
"build:docs:label-only":
labels:
- docs
- build_docs # for backward compatibility
deploy:
- preview
"build": "build":
labels: labels:
- build - build

View File

@@ -68,6 +68,7 @@ build_docs_html:
build_docs_pdf: build_docs_pdf:
extends: extends:
- .build_docs_build_stage_template - .build_docs_build_stage_template
- .rules:build:docs:label-only
artifacts: artifacts:
when: always when: always
paths: paths:
@@ -97,7 +98,7 @@ build_docs_pdf:
deploy_docs_preview: deploy_docs_preview:
extends: extends:
- .deploy_docs_template - .deploy_docs_template
- .rules:build:docs-preview - .rules:build:docs:label-only-preview
dependencies: # set dependencies to null to avoid missing artifacts issue dependencies: # set dependencies to null to avoid missing artifacts issue
needs: needs:
- build_docs_html - build_docs_html

View File

@@ -565,19 +565,6 @@
.rules:build:docs: .rules:build:docs:
rules: rules:
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build
- <<: *if-title-build
- <<: *if-label-build_docs
- <<: *if-title-build_docs
- <<: *if-label-docs
- <<: *if-title-docs
- <<: *if-dev-push
changes: *patterns-docs
.rules:build:docs-preview:
rules:
- <<: *if-label-build
- <<: *if-title-build
- <<: *if-label-build_docs - <<: *if-label-build_docs
- <<: *if-title-build_docs - <<: *if-title-build_docs
- <<: *if-label-docs - <<: *if-label-docs
@@ -589,6 +576,21 @@
rules: rules:
- <<: *if-protected-no_label - <<: *if-protected-no_label
.rules:build:docs:label-only:
rules:
- <<: *if-protected
- <<: *if-label-build_docs
- <<: *if-title-build_docs
- <<: *if-label-docs
- <<: *if-title-docs
.rules:build:docs:label-only-preview:
rules:
- <<: *if-label-build_docs
- <<: *if-title-build_docs
- <<: *if-label-docs
- <<: *if-title-docs
.rules:build:example_test-esp32: .rules:build:example_test-esp32:
rules: rules:
- <<: *if-protected - <<: *if-protected