-
Notifications
You must be signed in to change notification settings - Fork 27
/
travis-gh-pages.sh
executable file
·42 lines (32 loc) · 1.23 KB
/
travis-gh-pages.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -e # Exit with nonzero exit code if anything fails
# Save some useful information
REPO=`git config remote.origin.url`
SHA=`git rev-parse --verify HEAD`
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
OUT_KEY="sqlalchemy-media-travis-gh-pages"
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in travis_github_id_rsa.enc -out $OUT_KEY -d
chmod 600 $OUT_KEY
eval `ssh-agent -s`
ssh-add $OUT_KEY
# Clone/checkout the gh-pages branch from Github alongside the master branch working copy directory :
cd ..
git clone -b gh-pages [email protected]:pylover/sqlalchemy-media.git sqlalchemy-media.io
cd sqlalchemy-media.io
git pull origin gh-pages
cd ..
# Build in-project documents: docs/html
cd sqlalchemy-media/sphinx
make html
# Build sqlalchemy-media.io documents: ../../sqlalchemy-media.io
make sqlalchemy-media.io
# Commit & push
cd ../../sqlalchemy-media.io/
git config user.name "Travis CI"
git config user.email "$COMMIT_AUTHOR_EMAIL"
git commit -am "Deploy to GitHub Pages: ${SHA}"
git push origin gh-pages