Просмотр исходного кода

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
Fu Hanxi 5 лет назад
Родитель
Сommit
4c1fca4a77
3 измененных файлов с 20 добавлено и 12 удалено
  1. 7 2
      .gitlab/ci/dependencies/dependencies.yml
  2. 2 1
      .gitlab/ci/docs.yml
  3. 11 9
      .gitlab/ci/rules.yml

+ 7 - 2
.gitlab/ci/dependencies/dependencies.yml

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

+ 2 - 1
.gitlab/ci/docs.yml

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

+ 11 - 9
.gitlab/ci/rules.yml

@@ -565,8 +565,6 @@
 .rules:build:docs:
   rules:
     - <<: *if-protected
-    - <<: *if-label-build
-    - <<: *if-title-build
     - <<: *if-label-build_docs
     - <<: *if-title-build_docs
     - <<: *if-label-docs
@@ -574,20 +572,24 @@
     - <<: *if-dev-push
       changes: *patterns-docs
 
-.rules:build:docs-preview:
+.rules:build:docs-production:
   rules:
-    - <<: *if-label-build
-    - <<: *if-title-build
+    - <<: *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
-    - <<: *if-dev-push
-      changes: *patterns-docs
 
-.rules:build:docs-production:
+.rules:build:docs:label-only-preview:
   rules:
-    - <<: *if-protected-no_label
+    - <<: *if-label-build_docs
+    - <<: *if-title-build_docs
+    - <<: *if-label-docs
+    - <<: *if-title-docs
 
 .rules:build:example_test-esp32:
   rules: