From: Kaliko Jack <kaliko@azylum.org>
Date: Sat, 11 Nov 2023 14:29:37 +0000 (+0100)
Subject: ci: Add conditional builds
X-Git-Tag: v0.9.0~17
X-Git-Url: http://git.kaliko.me/?a=commitdiff_plain;h=b2ba6116b8d9dc60ce4033a57eb9441c72f73b25;p=python-musicpd.git

ci: Add conditional builds
---

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 35c8fe0..8b08de7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,8 +26,8 @@ stages:
     - py.test -q --cov=musicpd test.py
   rules:
     - changes:
-      - musicpd.py
-      - test.py
+        - musicpd.py
+        - test.py
     - if: $MUSICPD_TEST
 
 test-py3.11:
@@ -87,6 +87,10 @@ build:
       - dist/*.*
   rules:
     - if: $CI_PIPELINE_SOURCE == "push"
+      changes:
+        - .gitlab-ci.yml
+        - musicpd.py
+        - test.py
 
 tag_release:
   stage: build
@@ -104,6 +108,17 @@ tag_release:
   rules:
     - if: $CI_COMMIT_TAG
 
+# Documentation
+build_doc:
+  stage: build
+  script:
+    - pip install sphinx sphinx_rtd_theme
+    - sphinx-build doc/source -b html ./html -D html_theme=sphinx_rtd_theme
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "push"
+      changes:
+        - doc/source/*
+
 pages:
   stage: build
   script: