language: node_js
node_js:
  - 'stable'
cache:
  yarn: true
  directories:
    - node_modules
    - website/node_modules
branches:
  only:
    - master
    - next
install:
  - yarn global add codecov
  - yarn
script:
  - yarn run lint
  - yarn run test:ci && codecov
after_success:
  - |
    if [ "$TRAVIS_PULL_REQUEST" == "false" -a "$TRAVIS_BRANCH" == "master" ]; then
      git config --global user.name "React Native Elements CI"
      echo -e "machine github.com\n login react-native-elements-ci\n password $GITHUB_TOKEN" >> ~/.netrc
      cd website && yarn && GIT_USER=react-native-elements-ci yarn run publish-gh-pages
    fi
