diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c265b34c04aece6ebf0ff829c000c754eac07fed..c2d43366642e8a487b2b60d36c3025f79545d9ab 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -55,14 +55,13 @@ deploy:
     - cp ./ci_known_hosts ~/.ssh/known_hosts && chmod 0600 ~/.ssh/known_hosts
   script:
     - ansible-playbook --vault-password-file=.vault_pass --private-key "$CI_PRIVATE_KEY_FILE" -i inventory -i inventory_ci "$PLAYBOOK"
-  only:
-    - main
   retry: 1
   resource_group: infrastructure
   rules:
     - if: $CI_DEPLOY == "0"
       when: never
     - if: $CI_DEPLOY == "1"
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
   tags:
     - infrastructure