diff --git a/.travis.yml b/.travis.yml index 339d733..9c1c434 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,3 +14,33 @@ install: script: - python exp.py + +after_success: # Adapted from https://gist.github.com/domenic/ec8b0fc8ab45f39403dd + - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then echo "Don't build this"; exit 0; fi + - REPO=`git config remote.origin.url` + - SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} + - SHA=`git rev-parse --verify HEAD` + - git checkout --orphan gh-pages + - git rm -rf . # Does not remove .gitignored files + - git pull origin gh-pages + - mv soundhax.m4a soundhax-$TRAVIS_BRANCH.m4a + - git status + - if [[ -z `git diff --exit-code` ]]; then echo "No changes to the output on this push; exiting."; exit 0; fi + - git config user.name "Travis CI" + - git config user.email "travis@example.com" + - git add soundhax-$TRAVIS_BRANCH.m4a + - git commit -m "Deploy to GitHub Pages $SHA" + - ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" + - ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" + - ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} + - ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} + - openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d + - chmod 600 deploy_key + - eval `ssh-agent -s` + - ssh-add deploy_key + - git push $SSH_REPO gh-pages + +env: + global: + - ENCRYPTION_LABEL: "3df26cf223a2" + - COMMIT_AUTHOR_EMAIL: "travis@example.com"