diff --git a/.travis/deploy_docs.sh b/.travis/deploy_docs.sh index 13c5f82916..381cc8d94e 100755 --- a/.travis/deploy_docs.sh +++ b/.travis/deploy_docs.sh @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software @@ -49,8 +49,8 @@ if [[ "${BUILD_RELEASE}" == "unstable" ]]; then DOCS_DIR="unstable" elif [[ "${BUILD_FOCUS}" = "next" ]]; then DOCS_DIR="next-unstable" - else - _exit "Unknown build focus" 1 + else + _exit "Unknown build focus" 1 fi elif [[ "${BUILD_RELEASE}" == "stable" ]]; then @@ -59,8 +59,8 @@ elif [[ "${BUILD_RELEASE}" == "stable" ]]; then DOCS_DIR="latest" elif [[ "${BUILD_FOCUS}" = "next" ]]; then DOCS_DIR="next" - else - _exit "Unknown build focus" 1 + else + _exit "Unknown build focus" 1 fi else @@ -76,8 +76,13 @@ cp -rf ${DIR}/packages/composer-website/jekylldocs/_site/* ${TODIR}/${DOCS_DIR}/ # Add all the changes, commit, and push to the GitHub repository. cd ${TODIR} -git add . -git commit -m "Automatic deployment of website" -git push origin gh-pages +if git status --porcelain | grep . > /dev/null; then + echo "Found doc changes to push" + git add . + git commit -m "Automatic deployment of website" + git push origin gh-pages +else + echo "No doc changes to push" +fi _exit "All complete" 0