language: node_js

node_js:
- 7

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo pip install awscli

- npm install cloudfront-invalidate-cli

script:
- node ./internals/scripts/generate-templates-for-linting
- npm run test

after_success:
- npm run coveralls
- npm run build

before_deploy:
- aws s3 rm s3://$AWS_BUCKET --recursive

deploy:
  provider: s3
  bucket: $AWS_BUCKET
  on:
    branch: master
  local_dir: build
  skip_cleanup: true
  acl: public_read
  access_key_id: $AWS_ACCESS_KEY_ID
  secret_access_key: $AWS_SECRET_ACCESS_KEY

after_deploy:
- aws configure set preview.cloudfront true
- aws --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*"


notifications:
  email:
    on_failure: change

cache:
  yarn: true
  directories:
  - node_modules

language: node_js

node_js:
- 7

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo pip install awscli

- npm install cloudfront-invalidate-cli

script:
- node ./internals/scripts/generate-templates-for-linting
- npm run test

after_success:
- npm run coveralls
- npm run build

before_deploy:
- aws s3 rm s3://$AWS_BUCKET --recursive

deploy:
  provider: s3
  bucket: $AWS_BUCKET
  on:
    branch: master
  local_dir: build
  skip_cleanup: true
  acl: public_read
  access_key_id: $AWS_ACCESS_KEY_ID
  secret_access_key: $AWS_SECRET_ACCESS_KEY

after_deploy:
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*"

notifications:
  email:
    on_failure: change

cache:
  yarn: true
  directories:
  - node_modules

Fix aws cloudfront invalidation command
Fix aws cloudfront invalidation command
