CI: only build docs once

Change-Id: I8ef7cfce0f150eadd1ad88f2cac0e11cfd0ca54d
diff --git a/ci/build.sh b/ci/build.sh
index ba8db7b..059c265 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -89,7 +89,10 @@
 cmake -GNinja -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} -DCMAKE_INSTALL_PREFIX=${PREFIX} ${CMAKE_OPTIONS} ${ZUUL_PROJECT_SRC_DIR}
 ninja-build
 ctest -j${CI_PARALLEL_JOBS} --output-on-failure
-ninja-build doc
-pushd html
-zip -r ~/zuul-output/docs/html.zip .
-popd
+
+if [[ $JOB_PERFORM_EXTRA_WORK == 1 ]]; then
+    ninja-build doc
+    pushd html
+    zip -r ~/zuul-output/docs/html.zip .
+    popd
+fi