3set -e # Exit with nonzero exit code if anything fails
6TARGET_BRANCH="gh-pages"
10 ./runTestsAndCoverage.sh
13# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
14if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
15 echo "Skipping deploy; just doing a build."
20# Save some useful information
21REPO=`git config remote.origin.url`
22SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
23SHA=`git rev-parse --verify HEAD`
25# Clone the existing gh-pages for this repo into $OUTt/
26# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deply)
29git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
32# Clean out existing contents
33# rm -rf $OUT/* || exit 0
35# Run our compile script
38# Now let's go have some fun with the cloned repo
40git config user.name "Travis CI"
41git config user.email "$COMMIT_AUTHOR_EMAIL"
43# If there are no changes to the compiled out (e.g. this is a README update) then just bail.
44if [ -z `git diff --exit-code` ]; then
45 echo "No changes to the output on this push; exiting."
49# Commit the "changes", i.e. the new version.
50# The delta will show diffs between new and old versions.
52git commit -m "Deploy to GitHub Pages: ${SHA}"
54# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
55ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
56ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
57ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
58ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
59openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in ../deploy_key.enc -out ../deploy_key -d
60chmod 600 ../deploy_key
64# Now that we're all set up, we can push.
65git push $SSH_REPO $TARGET_BRANCH
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list