dist: xenial
language: node_js
node_js:
  - "6"

install: true

cache:
  directories:
    - node_modules

stages:
  - lint
  - build
  - name: deploy
    if: branch = master

jobs:
  include:
    - stage: lint
      script:
        - npm install
        - npm run lint
    - stage: build
      script:
        - npm install
        - npm run dist
    - stage: deploy
      script:
        - pip install --user awscli
        - npm install
        - npm run dist
        - aws s3 sync --delete dist/ s3://$S3_BUCKET_NAME/ --metadata-directive REPLACE --cache-control max-age=31536000
        - aws s3 cp dist/index.html s3://$S3_BUCKET_NAME/ --metadata-directive REPLACE --cache-control no-cache
        - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths '/*'

dist: xenial
language: node_js
node_js:
  - "10"

install: true

cache:
  directories:
    - node_modules

stages:
  - lint
  - build
  - name: deploy
    if: branch = master

jobs:
  include:
    - stage: lint
      script:
        - npm install
        - npm run lint
    - stage: build
      script:
        - npm install
        - npm run dist
    - stage: deploy
      script:
        - pip install --user awscli
        - npm install
        - npm run dist
        - aws s3 sync --delete dist/ s3://$S3_BUCKET_NAME/ --metadata-directive REPLACE --cache-control max-age=31536000
        - aws s3 cp dist/index.html s3://$S3_BUCKET_NAME/ --metadata-directive REPLACE --cache-control no-cache
        - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths '/*'

Use Node 10.x on Travis CI too
Use Node 10.x on Travis CI too

