diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f480880abdfc1dc1da9d123e04f49f5940f9a59d..a39cfc0665e08fa8e8f270825edc06b4ab78b93f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,8 +1,35 @@
+stages:
+  - test
+  - deploy
+
 trigger:
+  stage: deploy
   only:
     - master
   script:
     - "curl -X POST -F token=$GITLAB_TOKEN -F ref=master https://git.ok1kvk.cz/api/v3/projects/72/trigger/builds"
 
+before_script:
+  - node --version
+  - npm --version
+  - npm install
+
+basictest:
+  stage: test
+  script:
+    - node index.js --contentdir sitegin/tests/content --staticdir sitegin/tests/static --builddir build --noserver
+
+unittest:
+  stage: test
+  script:
+    - npm test
+  artifacts:
+    paths:
+      - coverage
+
+cache:
+  paths:
+    - node_modules
+
 # needs following env variable: $GITLAB_TOKEN