1#!/bin/bash
2
3set -o errexit -o nounset
4
5if test "x$TRAVIS_SECURE_ENV_VARS" != "xtrue"; then exit; fi
6
7TAG="$(git describe --exact-match --match "v[0-9]*" HEAD 2>/dev/null || true)"
8
9if test "x$TAG" = x; then exit; fi
10
11DOCSDIR=build-docs
12
13rm -rf $DOCSDIR || exit
14mkdir $DOCSDIR
15cd $DOCSDIR
16
17cp ../docs/html/* .
18
19git init
20git config user.name "Travis CI"
21git config user.email "travis@raqm.org"
22set +x
23echo "git remote add upstream \"https://\$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git\""
24git remote add upstream "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
25set -x
26git fetch upstream
27git reset upstream/gh-pages
28
29touch .
30git add -A .
31git commit -m "Rebuild docs for $TAG"
32git push -q upstream HEAD:gh-pages
33