language: node_js
node_js:
  - "node"
install:
- npm install

script:
- npm test

jobs:
  include:
    - stage: tag
      if: commit_message !~ /(no-deploy|wip)/
      node_js: "node"
      deploy:
        provider: script
        skip_cleanup: true
        script: scripts/travis.sh
        on:
          branch: master
          tags: false
    - stage: npm release
      node_js: "7"
      script: echo "Deploying to npm ..."
      deploy:
        provider: npm
        api_key: $travis_token
        email: "viditbhatia@hotmail.com"
        on:
          tags: true