language: node_js

node_js:
    - lts/carbon

env:
    global:
        - TAG_TYPE=$(git for-each-ref refs/tags | grep "${TRAVIS_TAG}"$ | cut -c 42-47)
        - GH_REPO=github.com/iCHEF/gypcrete.git

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: bash scripts/deploy.sh
      skip_cleanup: true
      on:
        tags: true
        condition: '"${TAG_TYPE}" == "commit"'

    - provider: pages
      skip_cleanup: true
      github_token: $GH_TOKEN
      keep_history: true
      local_dir: packages/storybook/public
      verbose: true
      on:
        tags: true
        condition: '"${TAG_TYPE}" == "commit"'

language: node_js

node_js:
    - lts/carbon

env:
    global:
        - TAG_TYPE=$(git for-each-ref refs/tags | grep "${TRAVIS_TAG}"$ | cut -c 42-47)
        - GH_REPO=github.com/iCHEF/gypcrete.git

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: bash scripts/deploy.sh
      skip_cleanup: true
      on:
        tags: true
        condition: '"${TAG_TYPE}" == "commit"'

    - provider: pages
      skip_cleanup: true
      github_token: $GH_TOKEN
      keep_history: true
      local_dir: packages/storybook/public
      verbose: true
      on:
        tags: true
        condition: '"${TAG_TYPE}" == "commit"'

Use Yarn comes from Node Docker image instead
Use Yarn comes from Node Docker image instead
