diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d2210463371bf44d06b9067d08c1743a06249e26..194d27931365c79ba0cc3bc68b1c9cd161cc854a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,28 +1,43 @@
 # CI Config for ltaftpy / gitlab
 
-#On X86_64 ubuntu
-unbutu:X86_64:
-  image: registry.gitlab.lif.univ-mrs.fr:5005/dev/ltfatpy/ubuntu:X86_64
-  tags:
-    - docker
+# nosetests template
+.nose: &nose
   script:
     - pip3 install -e .
     - nosetests3
+  artifacts:
+    paths:
+      - build
+    expire_in: 8d
+
+# doc template
+.doc: &doc
+    - pip3 install -e .
     - python3 setup.py build_sphinx
     - cp -r build/sphinx/html public
-  artifacts:
+    artifacts:
     paths:
       - public
-      - build
 
-#On i686 ubuntu
+# Tests on X86_64 ubuntu
+unbutu:X86_64:
+  <<: *nose
+  image: registry.gitlab.lif.univ-mrs.fr:5005/dev/ltfatpy/ubuntu:X86_64
+  tags:
+    - docker
+
+# Tests on i686 ubuntu
 ubuntu:i686:
+  <<: *nose
   image: registry.gitlab.lif.univ-mrs.fr:5005/dev/ltfatpy/ubuntu:i686
   tags:
     - docker
-  script:
-    - pip3 install -e .
-    - nosetests3
-  artifacts:
-    paths:
-      - build
\ No newline at end of file
+
+# Doc Generation
+pages:
+  <<: *doc
+  image: registry.gitlab.lif.univ-mrs.fr:5005/dev/ltfatpy/ubuntu:X86_64
+  tags:
+    - docker
+  only:
+    - master