UNPKG

772 BPlain TextView Raw
1#!/usr/bin/env bash
2
3set -e
4
5if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then
6 git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$' && {
7 rm -rf ../gh-pages
8 git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/epoberezkin/ajv.git ../gh-pages
9 mkdir -p ../gh-pages/_source
10 cp *.md ../gh-pages/_source
11 cp LICENSE ../gh-pages/_source
12 currentDir=$(pwd)
13 cd ../gh-pages
14 $currentDir/node_modules/.bin/gh-pages-generator
15 git config user.email "$GIT_USER_EMAIL"
16 git config user.name "$GIT_USER_NAME"
17 git add .
18 git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER"
19 git push --quiet origin gh-pages > /dev/null 2>&1
20 }
21fi