diff --git a/.travis.yml b/.travis.yml
index 048b94e..d12486b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,4 +36,4 @@ script:
- xvfb-run make test
after_success:
- - if [ "$GH_PASSWORD" ] && [ $CC = "gcc" ]; then cd ..; .travis/man2html.sh; fi
+ - if [ "$TRAVIS_BRANCH" = "$TRAVIS_TAG" ] && [ $CC = "gcc" ]; then cd ..; .travis/deploy-gh-pages.sh; fi
diff --git a/.travis/deploy-gh-pages.sh b/.travis/deploy-gh-pages.sh
new file mode 100755
index 0000000..609fffa
--- /dev/null
+++ b/.travis/deploy-gh-pages.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# If man had changed, rebuild its HTML and push to gh-pages
+
+set -eu
+
+[ "$GH_PASSWORD" ] || exit 12
+
+head=$(git rev-parse HEAD)
+
+git clone -b gh-pages "https://kernc:$GH_PASSWORD@github.com/$TRAVIS_REPO_SLUG.git" gh-pages
+groff -wall -mandoc -Thtml doc/xsuspender.1 > gh-pages/xsuspender.1.html
+cd gh-pages
+
+ANALYTICS=""
+sed -i "s#