2018-01-22 10:13:46 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e # exit with nonzero exit code if anything fails
|
|
|
|
|
2018-12-26 13:23:51 +00:00
|
|
|
BUMP="bump "
|
|
|
|
SITE="update site"
|
|
|
|
|
2019-01-12 10:52:58 +00:00
|
|
|
if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_COMMIT_MESSAGE == *$BUMP* || $TRAVIS_COMMIT_MESSAGE == *$SITE* ]]; then
|
2018-01-22 10:13:46 +00:00
|
|
|
|
|
|
|
echo "Starting to update gh-pages\n"
|
|
|
|
|
2019-02-23 04:12:44 +00:00
|
|
|
rm -rf _site
|
|
|
|
mkdir _site
|
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
|
|
|
|
2019-02-23 04:12:44 +00:00
|
|
|
cd _site
|
2018-01-22 10:13:46 +00:00
|
|
|
git init
|
|
|
|
git add -f .
|
|
|
|
git commit -m "Travis build"
|
2018-08-04 09:52:11 +00:00
|
|
|
git push --force --quiet "https://${GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.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;
|