deploy-to-gh-pages.sh 748 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. set -e # exit with nonzero exit code if anything fails
  3. BUMP="bump "
  4. SITE="update site"
  5. if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_COMMIT_MESSAGE == *$BUMP* || $TRAVIS_COMMIT_MESSAGE == *$SITE* ]]; then
  6. echo "Starting to update gh-pages\n"
  7. rm -rf _site
  8. mkdir _site
  9. git config --global user.email "travis@travis-ci.org"
  10. git config --global user.name "Travis"
  11. npm run site
  12. cd _site
  13. git init
  14. git add -f .
  15. git commit -m "Travis build"
  16. git push --force --quiet "https://${GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git" master:gh-pages > /dev/null
  17. echo "Done updating gh-pages\n"
  18. else
  19. echo "Skipped updating gh-pages, because build is not triggered from the master branch."
  20. fi;