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