UNPKG

932 Bapplication/x-shView Raw
1#!/usr/bin/env bash
2
3# inspired by http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
4
5if [ "$TRAVIS_REPO_SLUG" == "electronifie/accountifie-svc" ] && [ "$TRAVIS_NODE_VERSION" == "4.1" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
6
7 echo -e "Building docs...\n"
8 make docs
9
10 echo -e "Publishing docs...\n"
11 mv ./docs $HOME/api-docs
12
13 cd $HOME
14 git config --global user.email "travis@travis-ci.org"
15 git config --global user.name "travis-ci"
16 git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/electronifie/accountifie-svc gh-pages > /dev/null
17
18 cd gh-pages
19 mv .git ../.git_backup
20 rm -r *
21 mv ../.git_backup .git
22 cp -rf $HOME/api-docs/* .
23 git add -f .
24 git commit -m "Updating autogen'd docs for travis build $TRAVIS_BUILD_NUMBER."
25 git push -fq origin gh-pages > /dev/null
26
27 echo -e "Published docs to gh-pages."
28
29fi