diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index aa5ca78954e6424968f736738ce9223d791ef3b4..634858b3e0de5f9b4447106aee35c239f4b2c31e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,11 +1,22 @@
 ---
-image: node:14
-
 include:
   project: infra/gitlab
   ref: master
   file: templates/nodejs.ci.yml
 
+cache:
+  key: ${CI_COMMIT_REF_SLUG}
+  paths:
+    - .npm/
+
+default:
+  image: node:14
+
+stages:
+  - test
+  - prepare
+  - publish
+
 test:
   stage: test
   before_script:
@@ -17,7 +28,25 @@ test:
   tags:
     - test
 
+
+prepare:
+  stage: prepare
+  image: node:14
+  before_script:
+    - npm ci --cache .npm --prefer-offline
+    - npm install -g semantic-release@v17.1 @semantic-release/gitlab@6.0.5
+  script:
+    - npm run build
+  artifacts:
+    when: on_success
+    paths:
+      - dist
+    expire_in: 1 day
+  tags:
+    - test
+
 publish:
+  stage: publish
   extends: .publish_npm
   only:
     - master