From 22b07782ced6503a0bf33f2fe157b70540238f6d Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 14 Dec 2015 23:33:51 +0400 Subject: [PATCH] Deploy docs to gh-pages branch from Travis builds Build docs in Travis and push them to the gh-pages branch, which makes them available at http://behdad.github.io/harfbuzz/ --- .ci/deploy-docs.sh | 25 +++++++++++++++++++++++++ .travis.yml | 4 ++++ 2 files changed, 29 insertions(+) create mode 100755 .ci/deploy-docs.sh diff --git a/.ci/deploy-docs.sh b/.ci/deploy-docs.sh new file mode 100755 index 000000000..8c60a2242 --- /dev/null +++ b/.ci/deploy-docs.sh @@ -0,0 +1,25 @@ +set -o errexit -o nounset + +if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" == "gcc" -a "$TRAVIS_PULL_REQUEST" == "false" -a "$TRAVIS_BRANCH" == "master" ] +then + DOCSDIR=build-docs + REVISION=$(git rev-parse --short HEAD) + + rm -rf $DOCSDIR || exit + mkdir $DOCSDIR + cd $DOCSDIR + + cp ../docs/html/* . + + git init + git config user.name "Travis CI" + git config user.email "travis@harfbuzz.org" + git remote add upstream "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git" + git fetch upstream + git reset upstream/gh-pages + + touch . + git add -A . + git commit -m "Rebuild docs for $REVISION" + git push -q upstream HEAD:gh-pages +fi diff --git a/.travis.yml b/.travis.yml index 817811c4a..798f5eec6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ env: - CFLAGS="-Werror --coverage" - CXXFLAGS="-Werror --coverage" - LDFLAGS="--coverage" + - secure: "EysLG1MB6WCvDVpls5jsJAYsXcbHTmSFYl11UlAQCNfU+MBv7qiuOR6im3tM4ISzt4TY+OQXxEktMFRT+8govLR4UWo8dwmZ4P/2GqMbsZNPVSLkbDEy6hVv7xe5X4mp+npHthY1Z1YOLKGAh/u1PymySZz6qAzsCZ6Fq/H5Ri8=" install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then pip install --user nose; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then pip install --user cpp-coveralls; fi # for coveralls.io code coverage tracking @@ -23,11 +24,14 @@ install: script: - NOCONFIGURE=1 ./autogen.sh - export CONFIGURE_OPTS="--with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2" + - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" == "gcc" ]; then export CONFIGURE_OPTS="$CONFIGURE_OPTS --enable-gtk-doc"; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export CONFIGURE_OPTS="$CONFIGURE_OPTS --with-coretext"; fi - ./configure $CONFIGURE_OPTS - make - make check - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" == "gcc" ]; then rm -f src/.libs/NONE.gcov; touch src/NONE; coveralls; fi +after_success: + - bash .ci/deploy-docs.sh notifications: irc: "irc.freenode.org#harfbuzz" email: harfbuzz@lists.freedesktop.org