From 3baa409c0679ea84d04ef9aca27b34986c553106 Mon Sep 17 00:00:00 2001 From: Mathieu David Date: Sat, 1 Aug 2015 15:24:00 +0200 Subject: [PATCH] Added deploy script for gh-pages, I am not sure if it works. #23 --- .travis.yml | 16 ++++++++++------ deploy.sh | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 deploy.sh diff --git a/.travis.yml b/.travis.yml index cf5e769e..f9c4d80a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,13 @@ language: rust rust: - - stable - - beta - - nightly +- stable +- beta +- nightly matrix: - allow_failure: - - rust: nightly -# after_sucess: build a demo book an push to gh-pages branch + allow_failure: + - rust: nightly +env: + global: + secure: l3/qEC4krRerllLQzni8j5AjngFi6pluWvBWj//1mJLoIEYwxlQ9mYxEdd9BqccWWFn3K0bVYCVC/64+tP6sRfLkZCe2gPUtwe7ITwCDbapUxmkiRObVJCs5yMQZt6idyhHUDKAXKgNCrusfI2BM3tKGBfRK7Cnn/R/7p/U9+q7D1sgJtUKp6ypVzK6A3jLNp3dFLFI19a5KmbZMVsaa7tOhtdDJjjr7ebsc9z7HMW5/OItiWU3FSauVQQlUMaCiEgFuIG7H7OnBAYWB/gNEtLuwfLqU9UjtWk/njNNRnmJ7m3y5HbQhv5H5F5mJUOq9XFlPLwPwyTeVztSGdQm6k8Pp2pgKBUjY27afBl9BWU+msmN6k0oXfhvIebiBPe/x2udiKeFik1xqOOEU1q9dF0sZiuPxCSM1n7tgWklJ8epgaRQaMPPQw9pO/2H5/ynHCJqBlw6WcdiqWtwAyyr/GEx62u/cg5IVkqb7KLmYsWzjS8wYG4CYs1eIxCw2xPZxP0FGuUXvxTBUPipFze6Z7FqxVauXtVe2D7c1P4738HZP660rmR0GYtHtKLny1QxCCK9sxd9JmcezFCSz4YeQ1od9xc0OzGJ2ullKNGizmGfYmgL6X8faNylLIEdaiHAcY16xV3L0g3fXL1Qg360UHQyj7GIv+0nqQnf+H9xRTTU= +after_success: + - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 00000000..71f52839 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -o errexit -o nounset + +rev=$(git rev-parse --short HEAD) + +cd book-example/book + +git init +git config user.name "Mathieu David" +git config user.email "mathieudavid@mathieudavid.org" + +git remote add upstream "https://$GH_TOKEN@github.com/azerupi/mdBook.git" +git fetch upstream +git reset upstream/gh-pages + +touch . + +git add -A . +git commit -m "rebuild pages at ${rev}" +git push -q upstream HEAD:gh-pages