blob: a8a85233195d1b78fc361a27fdc71cb1880bee5d [file] [log] [blame]
Behdad Esfahbodd08035f2015-12-30 16:15:36 +01001#!/bin/bash
Khaled Hosnyb7891992015-12-26 06:35:08 +04002
Behdad Esfahbod0d45c3c2015-12-30 16:09:39 +01003set -x
Behdad Esfahbodd08035f2015-12-30 16:15:36 +01004set -o errexit -o nounset
Khaled Hosny22b07782015-12-14 23:33:51 +04005
Khaled Hosny3ce6c7b2017-12-06 21:08:20 +02006if test "x$TRAVIS_SECURE_ENV_VARS" != xtrue; then exit; fi
7
Behdad Esfahbodd08035f2015-12-30 16:15:36 +01008BRANCH="$TRAVIS_BRANCH"
Behdad Esfahbod33b2d982015-12-30 15:56:56 +01009if test "x$BRANCH" != xmaster; then exit; fi
10
Behdad Esfahbodd08035f2015-12-30 16:15:36 +010011TAG="$(git describe --exact-match --match "[0-9]*" HEAD 2>/dev/null || true)"
Behdad Esfahbodf3a05112015-12-30 15:45:43 +010012
Behdad Esfahbodf3a05112015-12-30 15:45:43 +010013DOCSDIR=build-docs
Behdad Esfahbod33b2d982015-12-30 15:56:56 +010014REVISION=$(git rev-parse --short HEAD)
Behdad Esfahbodf3a05112015-12-30 15:45:43 +010015
16rm -rf $DOCSDIR || exit
17mkdir $DOCSDIR
18cd $DOCSDIR
19
20cp ../docs/html/* .
Ebrahim Byagowia13c0742017-11-21 09:52:18 +033021#cp ../docs/CNAME .
Behdad Esfahbodf3a05112015-12-30 15:45:43 +010022
23git init
24git config user.name "Travis CI"
25git config user.email "travis@harfbuzz.org"
Behdad Esfahbod0d45c3c2015-12-30 16:09:39 +010026set +x
Ebrahim Byagowia13c0742017-11-21 09:52:18 +033027echo "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"
Behdad Esfahbod0d45c3c2015-12-30 16:09:39 +010029set -x
Behdad Esfahbodf3a05112015-12-30 15:45:43 +010030git fetch upstream
Ebrahim Byagowia13c0742017-11-21 09:52:18 +033031git reset upstream/master
Behdad Esfahbodf3a05112015-12-30 15:45:43 +010032
33touch .
34git add -A .
Khaled Hosny77efdec2017-11-22 00:14:29 +020035git commit -m "Rebuild docs for https://github.com/harfbuzz/harfbuzz/commit/$REVISION"
Ebrahim Byagowia13c0742017-11-21 09:52:18 +033036git push -q upstream HEAD:master