aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <felix.sipma@no-log.org>2018-02-02 11:59:39 +0100
committerFélix Sipma <felix.sipma@no-log.org>2018-02-02 11:59:39 +0100
commitad4dc28acb6d1cba2a6557ee3e3f40a9f8cdeef5 (patch)
treea1a9fd96e0016e60692348d83cf4cf9e974cdcf5
parent1a739d9fa6bc97067be96d8d17e61034fba1bed1 (diff)
add deploy.sh
-rw-r--r--deploy.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh
new file mode 100644
index 0000000..89a827c
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -o errexit -o nounset
+
+if [ "$TRAVIS_BRANCH" != "master" ]
+then
+ echo "This commit was made against the $TRAVIS_BRANCH and not the master! No deploy!"
+ exit 0
+fi
+
+rev=$(git rev-parse --short HEAD)
+
+cd stage/_book
+
+git init
+git config user.name "fournilsipma bot"
+git config user.email "gueux+fournilsipma@gueux.org"
+
+git remote add upstream "https://$GH_TOKEN@github.com/fournilsipma/fournilsipma.git"
+git fetch upstream
+git reset upstream/gh-pages
+
+echo "fournilsipma.fr" > CNAME
+
+touch .
+
+git add -A .
+git commit -m "rebuild pages at ${rev}"
+git push -q upstream HEAD:gh-pages