diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 800b68081e7cc2fac1155de231628ecb55244481..1e4fb0fcd988fe053ee31594c9126724b2293499 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -73,13 +73,27 @@ pages:
     paths: ['public']
     expire_in: 1d
 
-dist:
+dist-branch:
   stage: deploy
   variables:
     # Force a full clone to make version machinery work.
     GIT_STRATEGY: clone
   only:
-    - /^release\/[0-9]+\.[0-9]+\.[0-9]+.*$/
+    - /^release\/[0-9]+\.[0-9]+\.[0-9]+$/
+    - branches
+  script:
+    - bash tools/dist.sh
+  artifacts:
+    paths: ['dist']
+
+dist-tag:
+  stage: deploy
+  variables:
+    # Force a full clone to make version machinery work.
+    GIT_STRATEGY: clone
+  only:
+    - /^v\/[0-9]+\.[0-9]+\.[0-9]+.*$/
+    - tags
   script:
     - bash tools/dist.sh
   artifacts: