language: node_js
sudo: true
node_js:
  - "10.14.2"

demo/dist: xenial

branches:
  only:
  - master

before_script:
  - export CHROME_BIN=/usr/bin/google-chrome
  - export DISPLAY=:99.0
  - sudo apt-get update
  - wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P ~/
  - sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb

services:
  - xvfb

script: 
  - npm run lint
  - node_modules/.bin/karma start --single-run --no-fail-on-empty-test-suite
  - cd demo
  - npm install
  - node_modules/.bin/ng test --watch false
  - node_modules/.bin/webdriver-manager update
  - ng build --base-href "https://koderlabs.github.io/ngx-device-detector/demo/" --prod --output-hashing=all
  - cd ..
  - cp -R ./demo/dist ./docs/demo

deploy:
  provider: pages
  skip_cleanup: true
  github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
  local_dir: docs
  on:
    branch: master
language: node_js
sudo: true
node_js:
  - "10.14.2"

demo/dist: xenial

branches:
  only:
  - master
  tags: true

before_script:
  - export CHROME_BIN=/usr/bin/google-chrome
  - export DISPLAY=:99.0
  - sudo apt-get update
  - wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P ~/
  - sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb

services:
  - xvfb

script: 
  - npm run lint
  - node_modules/.bin/karma start --single-run --no-fail-on-empty-test-suite
  - cd demo
  - npm install
  - node_modules/.bin/ng test --watch false
  - node_modules/.bin/webdriver-manager update
  - ng build --base-href "https://koderlabs.github.io/ngx-device-detector/demo/" --prod --output-hashing=all
  - cd ..
  - cp -R ./demo/dist ./docs/demo

deploy:
  provider: pages
  skip_cleanup: true
  github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
  local_dir: docs
  on:
    branch: master
Add support for tag deploys
chore(ci): Add support for tag deploys

Added support for tags should trigger deployment
