1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-25 23:15:26 +00:00
notes/node_modules/ajv/scripts/travis-gh-pages

22 lines
772 B
Plaintext
Raw Normal View History

2017-03-09 18:16:08 +00:00
#!/usr/bin/env bash
set -e
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$' && {
rm -rf ../gh-pages
git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/epoberezkin/ajv.git ../gh-pages
mkdir -p ../gh-pages/_source
cp *.md ../gh-pages/_source
cp LICENSE ../gh-pages/_source
currentDir=$(pwd)
cd ../gh-pages
$currentDir/node_modules/.bin/gh-pages-generator
git config user.email "$GIT_USER_EMAIL"
git config user.name "$GIT_USER_NAME"
git add .
git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER"
git push --quiet origin gh-pages > /dev/null 2>&1
}
fi