Add Travis-CI deploy script.

This commit is contained in:
Tobias Gruetzmacher 2018-03-11 01:12:52 +01:00
parent dd1b6f0110
commit 211bc2ed92
4 changed files with 46 additions and 0 deletions

38
.github/deploy.sh vendored Executable file
View file

@ -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

BIN
.github/deploy_key.enc vendored Normal file

Binary file not shown.

1
.github/deploy_key.pub vendored Normal file
View file

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/I1J2fVYFzxQP7cZK32kI28cv94NH0xdq08OoIfwpz website-autodeploy

View file

@ -25,3 +25,10 @@ notifications:
- "chat.freenode.net#dosage" - "chat.freenode.net#dosage"
use_notice: true use_notice: true
skip_join: true skip_join: true
# Push site to gh-pages branch
deploy:
- provider: script
skip_cleanup: true
script: .github/deploy.sh
on:
branch: master