diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index de8aaa17ca0b0708eddd6a92d08246ba7db73556..af2aceaaea30a1db714319cd27ca7dc968158f3e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,4 +26,33 @@ pages:
       - public
   only:
     - main
+image: python:3.7
+
+before_script:
+  - pip install sphinx
+  - pip install -r requirements.txt
+
+stages:
+  - build
+  - deploy  # Add the deploy stage here
+
+build-docs:
+  stage: build
+  script:
+    - sphinx-build -b html source/ _build/html
+  artifacts:
+    paths:
+      - _build/html
+  only:
+    - main
+
+pages:
+  stage: deploy
+  script:
+    - mv _build/html public
+  artifacts:
+    paths:
+      - public
+  only:
+    - main