diff --git a/gitlab/build.sh b/gitlab/build.sh
index 3af02af73d064d7edaae42422ad6374f3c2d2bee..398ab3c1f17207f0bb827b705264ac959e8586ec 100755
--- a/gitlab/build.sh
+++ b/gitlab/build.sh
@@ -19,7 +19,7 @@ if [ -x ./bin/bob_dbmanage.py ]; then
   run_cmd ./bin/bob_dbmanage.py all download --missing;
 fi
 
-if [ -d ./doc ]; then
+if [ -d ./doc ] && [ "${STABLE}" != "true" ]; then
   run_cmd ./bin/sphinx-build -W doc sphinx
 fi