language: node_js

node_js:
    - lts/carbon

before_install:
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.7.0
    - export PATH=$HOME/.yarn/bin:$PATH

cache: yarn

install:
    - yarn

before_script:
    - yarn lint

script:
    - yarn test --bail

# Send coverage data to Coveralls
after_success:
    - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

before_deploy:
    - npm config set //registry.npmjs.org/:_authToken=\${NPM_TOKEN}
    - yarn run lerna run ghpages --scope @ichef/gypcrete-storybook

deploy:
    - provider: script
      script: yarn release:canary
      skip_cleanup: true
      on:
        branch: develop

    - provider: script
      script: yarn release
      skip_cleanup: true
      on:
        branch: master

    - provider: pages
      skip_cleanup: true
      github_token: $GH_TOKEN
      keep_history: true
      local_dir: packages/storybook/public
      verbose: true
      on:
        branch: master

env:
  global:
    - GH_REPO: github.com/iCHEF/gypcrete.git

language: node_js

node_js:
    - lts/carbon

before_install:
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.12.1
    - export PATH=$HOME/.yarn/bin:$PATH

cache: yarn

install:
    - yarn

before_script:
    - yarn lint

script:
    - yarn test --bail

# Send coverage data to Coveralls
after_success:
    - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

before_deploy:
    - npm config set //registry.npmjs.org/:_authToken=\${NPM_TOKEN}
    - yarn run lerna run ghpages --scope @ichef/gypcrete-storybook

deploy:
    - provider: script
      script: yarn release:canary
      skip_cleanup: true
      on:
        branch: develop

    - provider: script
      script: yarn release
      skip_cleanup: true
      on:
        branch: master

    - provider: pages
      skip_cleanup: true
      github_token: $GH_TOKEN
      keep_history: true
      local_dir: packages/storybook/public
      verbose: true
      on:
        branch: master

env:
  global:
    - GH_REPO: github.com/iCHEF/gypcrete.git

Update Travis CI to use latest stable build of Yarn
Update Travis CI to use latest stable build of Yarn
