From 1334ae10ab287ee213e9b5e57d12796f5553a3e9 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Mon, 1 Jan 2024 03:14:21 +0100
Subject: [PATCH] ci(docs): Use change based triggers for gitlab-ci

---
 docs/.gitlab-ci.yaml | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/docs/.gitlab-ci.yaml b/docs/.gitlab-ci.yaml
index de4a141f7..8ba8ca32b 100644
--- a/docs/.gitlab-ci.yaml
+++ b/docs/.gitlab-ci.yaml
@@ -14,7 +14,12 @@ build-docs:
   script:
     - mdbook build docs -d public
   rules:
-    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
+    - if: '$FORCE_DOCS_BUILD == true'
+    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
+      changes:
+        paths:
+          - ./docs/**/*
+          - ./**/README.md
   artifacts:
     expire_in: 1 week
     paths:
@@ -35,6 +40,11 @@ upload-docs:
   script:
     - mc cp public gitops-docs
   rules:
-    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
+    - if: '$FORCE_DOCS_BUILD == true'
+    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
+      changes:
+        paths:
+          - ./docs/**/*
+          - ./**/README.md
   tags:
     - kubernetes
\ No newline at end of file
-- 
GitLab