-
Add grunt-build-control to your app:
npm install --save grunt-build-control
-
Append its Grunt task:
buildcontrol: { options: { commit: true, tag: require('./package.json').version, push: true }, heroku: { options: { remote: 'git@heroku.com:[app].git', branch: 'master' } } }
-
Append a deploy script to
.travis.yml
:after_success: - ./scripts/deploy.sh
-
Drop in the deploy script:
#!/usr/bin/env bash set -e info() { echo "$0: $1"; } error() { info "$1"; exit 1; } [[ "$TRAVIS" ]] || error "This script assumes its running within Travis" [[ "$TRAVIS_PULL_REQUEST" == "true" ]] && error "Not deploying pull requests" [[ "$TRAVIS_BRANCH" == "master" ]] || error "Unsupported branch $TRAVIS_BRANCH" git config --global user.name "TravisCI" git config --global user.email "travis@example.com" ssh-keyscan -t rsa heroku.com >> ~/.ssh/known_hosts 2>/dev/null gem install heroku echo yes | heroku keys:add grunt build mv dist/index.html dist/index.php grunt buildcontrol:heroku heroku keys:remove "$(< ~/.ssh/id_rsa.pub)"
-
Add your Heroku API key to Travis:
travis env set HEROKU_API_KEY `heroku auth:token`
Created
November 21, 2014 19:13
-
-
Save tlvince/aed461c2d0a828235da6 to your computer and use it in GitHub Desktop.
Quick and dirty Yeoman-Travis-Heroku deployment for static apps
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
V. helpful.
Only one comment for future readers: I had to manually remove id_rsa from ~/.ssh/ otherwise the keys add command failed.