language: node_js

node_js:
  - 10

script:
  - yarn run format
  - yarn run lint
  - yarn run build
  - yarn run test:coverage

after_success:
  - npx codecov --file=./coverage/lcov.info
  - yarn workspace website run deploy

notifications:
  email: false

cache:
  yarn: true
  directories:
    - 'node_modules'

deploy:
  provider: pages
  skip-cleanup: true
  github-token: $GITHUB_TOKEN
  local_dir: website/public
  keep-history: true
  on:
    branch: gh-pages
