From 211bc2ed92ec0d2aa5bbde8b93bf681ded1c1db2 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 11 Mar 2018 01:12:52 +0100 Subject: [PATCH] Add Travis-CI deploy script. --- .github/deploy.sh | 38 ++++++++++++++++++++++++++++++++++++++ .github/deploy_key.enc | Bin 0 -> 400 bytes .github/deploy_key.pub | 1 + .travis.yml | 7 +++++++ 4 files changed, 46 insertions(+) create mode 100755 .github/deploy.sh create mode 100644 .github/deploy_key.enc create mode 100644 .github/deploy_key.pub diff --git a/.github/deploy.sh b/.github/deploy.sh new file mode 100755 index 000000000..10eb15b5d --- /dev/null +++ b/.github/deploy.sh @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +P="$(mktemp -d)" + +if [ "$encrypted_1671ba5f199a_key" ] +then + eval "$(ssh-agent -s)" + openssl aes-256-cbc -K $encrypted_1671ba5f199a_key -iv $encrypted_1671ba5f199a_iv \ + -in .github/deploy_key.enc -out .github/deploy_key -d + chmod 600 .github/deploy_key + ssh-add .github/deploy_key + + pip install git+https://github.com/spanezz/staticsite.git +fi + +[ -d $P ] && rm -Rfv $P +git clone --depth=10 --branch=gh-pages git@github.com:${TRAVIS_REPO_SLUG}.git $P + +ssite build + +rsync -r --del --verbose --exclude tests \ + --exclude dosagelib --exclude dist --exclude build --exclude scripts \ + ../*.site.out/* $P/ + +cd $P + +git config user.email 'nobody@23.gs' +git config user.name 'Travis-CI Website Bot' +git config push.default simple + +git add -A . +if [ "$TRAVIS_COMMIT" ] +then + git commit -a -m "Update website from commit $TRAVIS_COMMIT" + git push origin HEAD:gh-pages +fi + diff --git a/.github/deploy_key.enc b/.github/deploy_key.enc new file mode 100644 index 0000000000000000000000000000000000000000..f7508de395162e326904c8cc73f4bcc9a3ff4844 GIT binary patch literal 400 zcmV;B0dM{vb?0fV6*SBgHaKq!%4|U<#xA>Ktk^e7*txQGJ%^n6)R5aI+W>$fl8gX6 zZN=G!02??PIgR^}vYp0d-N| zepSIcUrgz|LW6?1$NB;BN!BIm{Ajms&Y)_1I2(CJ2Wh5?vLZkjwkD2N0jTtaVp}d( z6dH=N{--4l#AozOU6jc}Bh|cRb={4xoM%cBaY~~d)Z>wu%F*E+*GqBL;GzHPeB9_q zYsBjc>`GKmfOWpEccLL>>>)4qX*-hAV(O~K9nCSKwFtFQNQ`CO| literal 0 HcmV?d00001 diff --git a/.github/deploy_key.pub b/.github/deploy_key.pub new file mode 100644 index 000000000..90dd5482c --- /dev/null +++ b/.github/deploy_key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/I1J2fVYFzxQP7cZK32kI28cv94NH0xdq08OoIfwpz website-autodeploy diff --git a/.travis.yml b/.travis.yml index 82d4e9dad..78502ce93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,3 +25,10 @@ notifications: - "chat.freenode.net#dosage" use_notice: true skip_join: true +# Push site to gh-pages branch +deploy: + - provider: script + skip_cleanup: true + script: .github/deploy.sh + on: + branch: master