From ec3b5efa71c8e9bbf11a50cf76fd1ac3b731bc7d Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei.gherzan@huawei.com>
Date: Tue, 13 Apr 2021 12:00:32 +0100
Subject: [PATCH] .gitlab-ci.yml: Fix build docs rules

The generic pipelines triggers the build docs jobs based on the
assumption that the docs are in a docs subdirectoy. That is not the case
in the docs repository which includes only documentation.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 .gitlab-ci.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 17b127c..1b88168 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -50,6 +50,11 @@ build-docs:
   script:
     - !reference [.workspace, script]
     - !reference [.build-docs, script]
+  rules:
+    # Build the docs when a merge request is created.
+    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+    # Or when things land.
+    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
 
 deploy:
   extends: .workspace
-- 
GitLab