diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 49a2c7e9de7daaac4ad60c20d3014a7ae88f7184..935c5d448fdf0efc8ea93e1d4ab11b5f70978710 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -49,6 +49,8 @@ test_after_vips_common_changes:
 deploy-snapshot:
   stage: deploy
   script:
+    - export VERSION=$(./mvnw --batch-mode --no-transfer-progress --non-recursive help:evaluate -Dexpression=project.version | grep -v "\[.*")
+    - if ! [[ $VERSION =~ .*SNAPSHOT ]]; then exit 0; fi
     - ./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS deploy -DskipTests
   tags:
     - vips-java