From a81fa0866c6fe8f4784b1b26d113bd3a68364b6b Mon Sep 17 00:00:00 2001
From: Ole Langbehn <ole.langbehn@inoio.de>
Date: Wed, 12 Mar 2025 17:47:39 +0100
Subject: [PATCH] fix: switch from deprecated only to rules, dont use changes
 rules on manual builds

---
 .gitlab-ci.yml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6ebcb26..c62f910 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,8 +47,9 @@ staging_deploy:
   extends: .deploy
   variables:
     ENVIRONMENT_ID: 'staging'
-  only:
-    - main
+  rules:
+    - if: $CI_COMMIT_BRANCH == "main"
+      when: on_success
   resource_group: staging
 
 production_deploy:
@@ -57,6 +58,7 @@ production_deploy:
   needs: ["staging_deploy"]
   variables:
     ENVIRONMENT_ID: 'production'
-  only:
-    - main
+  rules:
+    - if: $CI_COMMIT_BRANCH == "main"
+      when: on_success
   resource_group: production
-- 
GitLab