diff --git a/.gitlab/ci/jobs/doc/publish.yml b/.gitlab/ci/jobs/doc/publish.yml index 1b4856b5eb887695110801e94958b721f7cfabf4..92def03e326b81550f1a0eb64fddaad7e5c19267 100644 --- a/.gitlab/ci/jobs/doc/publish.yml +++ b/.gitlab/ci/jobs/doc/publish.yml @@ -12,6 +12,9 @@ publish:documentation: - .default_settings_template - .image_template__runtime_build_test_dependencies_template stage: doc + # Make the publish_documentation run in the beginning of the master + # pipeline to ensure it has time to run before the next merge. + needs: [] before_script: - echo "${CI_PK_GITLAB_DOC}" > ~/.ssh/id_ed25519 - echo "${CI_KH}" > ~/.ssh/known_hosts diff --git a/scripts/ci/doc_publish.sh b/scripts/ci/doc_publish.sh index d404adc7fe68d2b3fe2ff2ea126910bf999c6bb5..6a1abb15ca5e4de717623052efe6486abebc70f9 100755 --- a/scripts/ci/doc_publish.sh +++ b/scripts/ci/doc_publish.sh @@ -2,20 +2,21 @@ cd "${CI_PROJECT_DIR}" || exit 1 +make all ; +make -C docs -j full ; + if [ "${CI_COMMIT_REF_NAME}" == "master" ] ; then - make all ; - make -C docs -j full ; git clone --depth 5 git@gitlab.com:"${CI_PROJECT_NAMESPACE}"/"${CI_PROJECT_NAMESPACE}".gitlab.io gitlab.io ; rsync --recursive --links --perms --delete --exclude=.doctrees --exclude={{main,alpha,zero}net,master}/index.html docs/_build/ gitlab.io/public/ ; cd gitlab.io || exit 2; -else - echo "Skip pushing documentation. Only pushing for real master" ; -fi -if [ -z "$(git status -s)" ] ; then - echo "Nothing to commit!" ; + if [ -z "$(git status -s)" ] ; then + echo "Nothing to commit!" ; + else + git add public ; + git commit -m "Import doc of ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_SHA}" ; + git push origin master ; + fi else - git add public ; - git commit -m "Import doc of ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_SHA}" ; - git push origin master ; + echo "Skip pushing documentation. Only pushing for real master" ; fi