Commit 92f23d64 authored by Pascal Hartig's avatar Pascal Hartig

Add .travis.yml

The script is going to build `master` with `gulp` on every push and, if
successful, push the resulting `dist/` to `gh-pages`.
parent a3993c0e
# You must sign into travis-ci.org and set the commit hook on your project for travis to
# run on your project. The secure: variable must be generated by running `travis encrypt`
# on a github oauth key that you can generate using curl.
language:
node_js
node_js:
- 0.10
notifications:
irc: "irc.freenode.org#tastejs"
branches:
only:
- master
env:
global:
# GH_OAUTH_TOKEN is the oauth token generated as described at
# https://help.github.com/articles/creating-an-oauth-token-for-command-line-use
#
# curl -u 'username' -d '{"scopes":["repo"],"note":"push to gh-pages from travis"}' https://api.github.com/authorizations
#
# It must be encrypted using the travis gem
# http://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables
#
# travis encrypt GH_OAUTH_TOKEN=XXXXXXXXXXXXXXX
#
# User specific env variables
- secure: "fHgfjMpYuliwMr2QLnjYZExIViNrxprf9dhXRBLZ6P9Hz7P6m1BMYrI/xEG8X+fFbCi0+n3AXh8SEMHi9ou/Pty/cx12z4w/z3B2BHMxh4XBwpZHs+AB4IXkLiwwWoP4QFy4vTipgYnMDMq9CRhlRbhZEpenQBmaTEc472By1uM="
- GH_OWNER: tastejs
- GH_PROJECT_NAME: todomvc
before_script:
# install dependencies
- npm install -g gulp
script:
# We want to gate on passing tests and a successful build
- gulp
after_success:
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
- git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} site > /dev/null 2>&1
- cd site
- if git checkout gh-pages; then git checkout -b gh-pages; fi
- git rm -r .
- cp -R ../dist/* .
- cp ../dist/.* .
- git add -f .
- git config user.email "travis@rdrei.net"
- git config user.name "TasteBot"
- git commit -am "update the build files for gh-pages [ci skip]"
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
- git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages > /dev/null 2>&1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment