diff --git a/gitlab/deploy.sh b/gitlab/deploy.sh
index cc1cfb5e9437dab22d2e2a76aa2dbe87c318833e..d7c131c5708d06e539e2a1d17ac007acbff86f22 100755
--- a/gitlab/deploy.sh
+++ b/gitlab/deploy.sh
@@ -3,6 +3,11 @@
 
 source $(dirname ${0})/functions.sh
 
+# upload documentation on our internal server
+run_cmd $(dirname ${0})/before_docs.sh
+run_cmd $(dirname ${0})/docs.sh
+run_cmd $(dirname ${0})/after_docs.sh
+
 if [ "${VISIBILITY}" != "public" ]; then
   log_error "ERROR: You cannot publish a PRIVATE to PyPI"
   log_error "ERROR: Make this package public before re-trying!"
@@ -23,9 +28,6 @@ setup_deploy check sdist --formats zip upload --repository production
 if [ -d sphinx ]; then
   log_info "Uploading documentation to ${PYPISERVER} on behalf of ${PYPIUSER}..."
   setup_deploy upload_docs --upload-dir sphinx --repository production
-  run_cmd $(dirname ${0})/before_docs.sh
-  run_cmd $(dirname ${0})/docs.sh
-  run_cmd $(dirname ${0})/after_docs.sh
 fi
 
 unlock_pypirc
diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index 157c373092c26aee5ab7c9d40fad2c9963c88694..83ca82630b0a9e425f6da75520176cd188a9a65f 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -421,9 +421,9 @@ export_env BOB_PREFIX_PATH
 
 # Setup default documentation server
 if [ -z "${CI_COMMIT_TAG}" ]; then
-  DEFSRV="${DOCSERVER}/software/bob/docs/bob/%s/master/"
+  DEFSRV="${DOCSERVER}/software/bob/docs/bob/%(name)s/master/"
 else
-  DEFSRV="${DOCSERVER}/software/bob/docs/bob/%s/stable/|http://pythonhosted.org/%s/"
+  DEFSRV="${DOCSERVER}/software/bob/docs/bob/%(name)s/%(version)s/|${DOCSERVER}/software/bob/docs/bob/%(name)s/stable/|http://pythonhosted.org/%(name)s/"
 fi
 if [ -z "${BOB_DOCUMENTATION_SERVER}" ]; then
   BOB_DOCUMENTATION_SERVER="${DEFSRV}"
@@ -432,7 +432,11 @@ else
 fi
 if [ "${VISIBILITY}" != "public" ]; then
   # If private or internal, allow it to depend on other internal documents
-  BOB_DOCUMENTATION_SERVER="${BOB_DOCUMENTATION_SERVER}|${DOCSERVER}/private/docs/bob/%s/master/"
+  if [ -z "${CI_COMMIT_TAG}" ]; then
+    BOB_DOCUMENTATION_SERVER="${BOB_DOCUMENTATION_SERVER}|${DOCSERVER}/private/docs/bob/%(name)s/master/"
+  else
+    BOB_DOCUMENTATION_SERVER="${BOB_DOCUMENTATION_SERVER}|${DOCSERVER}/private/docs/bob/%(name)s/%(version)s/|${DOCSERVER}/private/docs/bob/%(name)s/stable/"
+  fi
 fi
 unset DEFSRV
 export_env BOB_DOCUMENTATION_SERVER