| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | set -e # exit with nonzero exit code if anything fails |
| 3 | export GH_PAGES_DIR="$HOME/gh-pages" |
| 4 | |
| 5 | # Decrypt and activate the deploy key |
| 6 | echoscip-shell system . . echo. Setting up access... |
| 7 | opensslscip-shell system . . openssl. aes-256-cbc -K $encrypted_2f711532c6dd_key -iv $encrypted_2f711532c6dd_iv -in ${TRAVIS_BUILD_DIR}/ci/deploy_key.enc -out ${TRAVIS_BUILD_DIR}/ci/deploy_key -d |
| 8 | chmodscip-shell system . . chmod. 600 ${TRAVIS_BUILD_DIR}/ci/deploy_key |
| 9 | eval `ssh-agentscip-shell system . . ssh-agent. -s` |
| 10 | ssh-addscip-shell system . . ssh-add. ${TRAVIS_BUILD_DIR}/ci/deploy_key |
| 11 | |
| 12 | # Clone *this* git repo, but only the gh-pages branch. |
| 13 | echoscip-shell system . . echo. Cloning gh-pages... |
| 14 | if [[ ! -d $GH_PAGES_DIR ]]; then |
| 15 | gitscip-shell system . . git. clone -q -b gh-pages --single-branch [email protected]:${TRAVIS_REPO_SLUG}.git $GH_PAGES_DIR |
| 16 | fi |
| 17 | cd $GH_PAGES_DIR |
| 18 | |
| 19 | # inside this git repo we'll pretend to be a new user |
| 20 | gitscip-shell system . . git. config user.name "Travis CI" |
| 21 | gitscip-shell system . . git. config user.email "[email protected]" |
| 22 | |
| 23 | # The first and only commit to this new Git repo contains all the |
| 24 | # files present with the commit message "Deploy to GitHub Pages". |
| 25 | echoscip-shell system . . echo. Updating docs... |
| 26 | rmscip-shell system . . rm. -rf * |
| 27 | cpscip-shell system . . cp. -R ${TRAVIS_BUILD_DIR}/docs/_build/html/* ./ |
| 28 | touchscip-shell system . . touch. .nojekyll |
| 29 | |
| 30 | echoscip-shell system . . echo. Staging... |
| 31 | gitscip-shell system . . git. add -A . |
| 32 | gitscip-shell system . . git. commit --amend --reset-author --no-edit |
| 33 | |
| 34 | # Push up to gh-pages |
| 35 | echoscip-shell system . . echo. Pushing... |
| 36 | gitscip-shell system . . git. push --force origin gh-pages |