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