Publish book from both the edge and beta channels

This commit is contained in:
Michael Vines 2019-01-12 10:43:25 -08:00 committed by Grimes
parent 5b92286568
commit 5d3847d14d
1 changed files with 22 additions and 11 deletions

View File

@ -16,18 +16,29 @@ echo --- create book repo
git commit -m "${BUILDKITE_COMMIT:-local}"
)
echo --- publish
if [[ $BUILDKITE_BRANCH = master ]]; then
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
eval "$(ci/channel-info.sh)"
# Only publish the book from the edge and beta channels for now.
case $CHANNEL in
edge)
repo=git@github.com:solana-labs/book-edge.git
;;
beta)
repo=git@github.com:solana-labs/book.git
;;
*)
echo "--- publish skipped"
exit 0
;;
esac
echo "--- publish $CHANNEL"
cd book/html/
git remote add origin $repo
git fetch origin master
if ! git diff HEAD origin/master --quiet; then
git push -f origin HEAD:master
else
echo "Publish skipped"
echo "Content unchanged, publish skipped"
fi
exit 0