language: node_js
services:
  - mongodb
jobs:
  include:
    - stage: Test
      node_js: 8
      script: yarn test
    - node_js: 10
      script: yarn test
    - node_js: 12
      script:
        - yarn lint:commit-travis
        - yarn lint
        - yarn test
      after_success: yarn coveralls
    - stage: Deploy
      if: branch = master AND type = push
      node_js: 12
      script: yarn build
      deploy:
        - provider: script
          skip_cleanup: true
          script: yarn semantic-release
        - provider: pages
          skip_cleanup: true
          github_token: $GH_TOKEN
          local_dir: ./docs
          keep_history: true
