2 title: Deploy gh-pages via Travis
6 Taken from https://medium.com/@nthgergo/publishing-gh-pages-with-travis-ci-53a8270e87db
8 ### Create an OAuth token and encrypt it
10 Use https://github.com/settings/tokens/new
15 travis encrypt -r user/repo GITHUB_TOKEN=[the token here]
18 ### Make it run the deploy script on deploy
23 - bash ./scripts/deploy-to-gh-pages.sh
26 - GITHUB_REPO: "user/repo"
27 - secure: "nlnXJW/imf/w..." # <-- from travis-encrypt
32 Create the file `scripts/deploy-to-gh-pages.sh`
36 # See https://medium.com/@nthgergo/publishing-gh-pages-with-travis-ci-53a8270e87db
43 git config --global user.email "nobody@nobody.org"
44 git config --global user.name "Travis CI"
53 git commit -m "Deploy to Github Pages"
54 git push --force --quiet "https://${GITHUB_TOKEN}@$github.com/${GITHUB_REPO}.git" master:gh-pages > /dev/null 2>&1
57 From Ractive, this might be useful in certain cases:
60 if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi