diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ed1290b9166dfa72bee7641ef35490ca35bfe15d..5be02ed47b4aec7cc52349b46173a5b95002e24c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,10 @@ image: danteev/texlive
 
 compile-thesis:
   stage: build
+  rules:
+    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
+    - if: $CI_COMMIT_TAG
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
   script:
     - latexmk -pdf thesis
   artifacts: