diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 10bd3c4f9488bc96dcd92cb9b654b925757ae21f..b9c296b36bde6ac609a63fa808b0fba808238078 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,6 +22,7 @@ doc:
         - export LC_ALL=$(locale -a | grep en_US)
         - export LANG=$(locale -a | grep en_US)
         - pip3 install -e .[doc]
+        - rm -Rf build/sphinx/html
         - python3 setup.py build_sphinx
     artifacts:
         paths: