From 6fafc77d03af66c6eb5b93b3e4a0c364cb6be730 Mon Sep 17 00:00:00 2001
From: Janne Mareike Koschinski <janne@kuschku.de>
Date: Tue, 31 May 2022 01:25:49 +0200
Subject: [PATCH] ci: only run jobs if the corresponding files have changed

---
 actual/pipeline.yml       | 5 +++++
 imghost/pipeline.yml      | 5 +++++
 jellyfin/pipeline.yml     | 5 +++++
 languagetool/pipeline.yml | 5 +++++
 mailu/pipeline.yml        | 5 +++++
 oauth2-proxy/pipeline.yml | 5 +++++
 quassel/pipeline.yml      | 5 +++++
 restic/pipeline.yml       | 5 +++++
 8 files changed, 40 insertions(+)

diff --git a/actual/pipeline.yml b/actual/pipeline.yml
index 7448b18..a245712 100644
--- a/actual/pipeline.yml
+++ b/actual/pipeline.yml
@@ -1,5 +1,8 @@
 lint-actual:
   stage: lint
+  rules:
+    - changes:
+        - actual/**/*
   script:
     - helm lint actual
 
@@ -9,6 +12,8 @@ release-actual:
     - lint-actual
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - actual/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
diff --git a/imghost/pipeline.yml b/imghost/pipeline.yml
index 1c83112..6b5fca0 100644
--- a/imghost/pipeline.yml
+++ b/imghost/pipeline.yml
@@ -1,5 +1,8 @@
 lint-imghost:
   stage: lint
+  rules:
+    - changes:
+        - imghost/**/*
   script:
     - helm lint imghost
 
@@ -9,6 +12,8 @@ release-imghost:
     - lint-imghost
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - imghost/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
diff --git a/jellyfin/pipeline.yml b/jellyfin/pipeline.yml
index 2506eaa..7290f5d 100644
--- a/jellyfin/pipeline.yml
+++ b/jellyfin/pipeline.yml
@@ -1,5 +1,8 @@
 lint-jellyfin:
   stage: lint
+  rules:
+    - changes:
+        - jellyfin/**/*
   script:
     - helm lint jellyfin
 
@@ -9,6 +12,8 @@ release-jellyfin:
     - lint-jellyfin
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - jellyfin/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
diff --git a/languagetool/pipeline.yml b/languagetool/pipeline.yml
index 22a976b..f6738c1 100644
--- a/languagetool/pipeline.yml
+++ b/languagetool/pipeline.yml
@@ -1,5 +1,8 @@
 lint-languagetool:
   stage: lint
+  rules:
+    - changes:
+        - languagetool/**/*
   script:
     - helm lint languagetool
 
@@ -9,6 +12,8 @@ release-languagetool:
     - lint-languagetool
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - languagetool/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
diff --git a/mailu/pipeline.yml b/mailu/pipeline.yml
index 002c98a..a7d3ccf 100644
--- a/mailu/pipeline.yml
+++ b/mailu/pipeline.yml
@@ -1,5 +1,8 @@
 lint-mailu:
   stage: lint
+  rules:
+    - changes:
+      - mailu/**/*
   script:
     - helm lint mailu
 
@@ -9,6 +12,8 @@ release-mailu:
     - lint-mailu
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - mailu/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
diff --git a/oauth2-proxy/pipeline.yml b/oauth2-proxy/pipeline.yml
index fc476a9..900b7da 100644
--- a/oauth2-proxy/pipeline.yml
+++ b/oauth2-proxy/pipeline.yml
@@ -1,5 +1,8 @@
 lint-oauth2-proxy:
   stage: lint
+  rules:
+    - changes:
+        - oauth2-proxy/**/*
   script:
     - helm lint oauth2-proxy
 
@@ -9,6 +12,8 @@ release-oauth2-proxy:
     - lint-oauth2-proxy
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - oauth2-proxy/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
diff --git a/quassel/pipeline.yml b/quassel/pipeline.yml
index d540fb3..b5a7a1a 100644
--- a/quassel/pipeline.yml
+++ b/quassel/pipeline.yml
@@ -1,5 +1,8 @@
 lint-quassel:
   stage: lint
+  rules:
+    - changes:
+        - quassel/**/*
   script:
     - helm lint quassel
 
@@ -9,6 +12,8 @@ release-quassel:
     - lint-quassel
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - quassel/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
diff --git a/restic/pipeline.yml b/restic/pipeline.yml
index d5129fa..231d308 100644
--- a/restic/pipeline.yml
+++ b/restic/pipeline.yml
@@ -1,5 +1,8 @@
 lint-restic:
   stage: lint
+  rules:
+    - changes:
+        - restic/**/*
   script:
     - helm lint restic
 
@@ -9,6 +12,8 @@ release-restic:
     - lint-restic
   rules:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      changes:
+        - restic/**/*
   script:
     - apk add --no-cache git
     - helm plugin install https://github.com/chartmuseum/helm-push.git
-- 
GitLab