diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7bfaf44e..e24d1925 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,36 +1,51 @@
 image: node:latest
 
 stages:
+    - prepare
     - test
     - build
     - deploy
 
-cache:
-    key: ${CI_COMMIT_REF_SLUG}
+cache: &global_cache
+    key:
+        files:
+            - package-lock.json
+    policy: pull
+    untracked: true
     paths:
-        - .npm/
+        - node_modules/
+
+install-dependencies:
+    stage: prepare
+    script:
+        - npm ci
+    cache:
+        <<: *global_cache
+        policy: pull-push
 
 lint:
     stage: test
-    before_script:
-        - npm ci --cache .npm --prefer-offline
     script:
         - npm run lint
+    cache:
+        <<: *global_cache
 
 # Test:
 #     stage: Test
 #     script:
 #         - npm test
+#    cache:
+#        <<: *global_cache
 
 build:
     stage: build
-    before_script:
-        - npm ci --cache .npm --prefer-offline
     script:
         - npm run build
+    cache:
+        <<: *global_cache
     artifacts:
         paths:
-            - dist
+            - dist/
         expire_in: 1 week
 
 deploy: