ant-design-vue/scripts/deploy-to-gh-pages.sh

29 lines
643 B
Bash
Raw Normal View History

2018-01-22 10:13:46 +00:00
#!/bin/bash
set -e # exit with nonzero exit code if anything fails
if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then
echo "Starting to update gh-pages\n"
2018-04-04 10:39:21 +00:00
rm -rf site-dist
mkdir site-dist
2018-01-22 10:13:46 +00:00
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
2018-04-04 10:39:21 +00:00
npm run site
2018-01-22 10:13:46 +00:00
2018-04-04 10:39:21 +00:00
cd site-dist
2018-01-22 10:13:46 +00:00
git init
git add -f .
git commit -m "Travis build"
2018-01-22 10:56:58 +00:00
git push --force --quiet "https://${GITHUB_TOKEN}@github.com/vueComponent/ant-design.git" master:gh-pages > /dev/null
2018-01-22 10:13:46 +00:00
echo "Done updating gh-pages\n"
else
echo "Skipped updating gh-pages, because build is not triggered from the master branch."
fi;