diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e919cbf73c64ca8013673de983e712932bff0b90..c824a69c2255aed43830d1ee4594943439e9adfa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,9 @@
+stages:
+  - build
+  - docs
+  - deploy
+
+
 image: debian:latest
 before_script:
   - apt update && apt -y install git gcc cmake mpich
@@ -18,12 +24,10 @@ build_python:
   stage: build
   before_script:
     - apt update && apt -y install git gcc cmake mpich python3 python3-pip
-    - pip install numpy virtualenv
-    - virtualenv venv
-    - source venv/bin/activate
+    - python3 -m pip install numpy
   script:
-    - python setup.py bdist_wheel
-    - pip install dist/*
+    - python3 setup.py bdist_wheel
+    - python3 -m pip install dist/*
   artifacts:
     paths:
       - dist/*.whl
@@ -33,3 +37,20 @@ build_python:
     paths:
       - .cache/pip
       - venv/
+
+build_docs:
+  stage: docs
+  dependencies:
+    - build_python
+  before_script:
+    - apt update && apt -y install mpich python3 python3-pip
+    - python3 -m pip install --upgrade pip
+    - python3 -m pip install numpy
+    - python3 -m pip install dist/*
+    - python3 -m pip install Sphinx sphinx-rtd-theme sphinxcontrib-napoleon numpydoc myst-parser
+  script:
+    - cd docs
+    - make dirhtml
+  artifacts:
+    paths:
+      - docs/_build/dirhtml/