general:
  branches:
    ignore:
      - gh-pages

machine:
  pre:
    - mkdir ~/.yarn-cache
  node:
    version: stable
  environment:
    YARN_VERSION: 0.19.1
    PATH: "${PATH}:${HOME}/.yarn/bin"

dependencies:
  pre:
    - |
      if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then
          curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
      fi
  cache_directories:
    - ~/.yarn
    - ~/.yarn-cache
  override:
    - yarn install

test:
  override:
    - yarn run test-all

deployment:
  master:
    branch: master
    owner: bigdatr
    commands:
      - git config --global user.email <%= author %>
      - git config --global user.name <%= author %>
      - yarn run deploy-to-gh-pages
