dist: trusty
sudo: false

language: node_js
cache: npm

node_js: v10
env:
- npm_version=6
  DEBUG=tape-spawn
  SHARP_IGNORE_GLOBAL_LIBVIPS=1

before_install:
- npm i -g npm@${npm_version}

install:
- npm ci
- npm run install:all

after_success:
- make build-html
- make build-odt
- make build-docbook

before_deploy:
- git-lfs pull

deploy:
  - provider: pages
    skip-cleanup: true
    github-token: "$GH_TOKEN"
    local-dir: dist
    on:
      branch: master
  - provider: releases
    prerelease: true
    skip-cleanup: true
    api-key: "$GH_TOKEN"
    file-glob: true
    file: dist/book.*
    on:
      tags: true
  - provider: npm
    skip-cleanup: true
    on:
      tags: true
    email: "hi@oncletom.io"
    api-key: "$NPM_TOKEN"
