From 29776c0283f79ed4adae324f119bbadbe6ddb6fe Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 17 Dec 2018 15:35:59 -0800 Subject: [PATCH] Publish book only on content changes instead of on every commit --- ci/publish-book.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ci/publish-book.sh b/ci/publish-book.sh index 46ac841e05..620324d9ce 100755 --- a/ci/publish-book.sh +++ b/ci/publish-book.sh @@ -35,12 +35,14 @@ echo --- create book repo echo --- publish if [[ $BUILDKITE_BRANCH = master ]]; then - ( - set -x - cd book/html/ - git remote add origin git@github.com:solana-labs/solana.git + cd book/html/ + git remote add origin git@github.com:solana-labs/solana.git + git fetch origin gh-pages + if ! git diff HEAD origin/gh-pages --quiet; then git push -f origin HEAD:gh-pages - ) + else + echo "Content unchanged, publish skipped" + fi else echo "Publish skipped" fi