From 676b8d50925f223c311d7c2daf3409ef06162f0f Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Fri, 23 Jan 2015 09:18:39 +0800 Subject: [PATCH] Update --- travis-gh-pages.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/travis-gh-pages.md b/travis-gh-pages.md index 2f4464943..96634158b 100644 --- a/travis-gh-pages.md +++ b/travis-gh-pages.md @@ -21,21 +21,21 @@ travis encrypt -r user/repo GH_TOKEN=[the token here] ### Make it run the deploy script on deploy -``` +```yaml # .travis.yml script: - bash ./scripts/deploy-to-gh-pages.sh env: global: - GH_REF: "github.com/user/repo.git" - - secure: "nlnXJW/imf/w..." + - secure: "nlnXJW/imf/w..." # <-- from travis-encrypt ``` ### Write deployer Create the file `scripts/deploy-to-gh-pages.sh` -``` +```sh #!/bin/bash # See https://medium.com/@nthgergo/publishing-gh-pages-with-travis-ci-53a8270e87db set -o errexit @@ -58,7 +58,7 @@ git commit -m "Deploy to Github Pages" git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 ``` -From Ractive: +From Ractive, this might be useful in certain cases: ``` if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi