cache: bundler
language: ruby
sudo: false

addons:
    apt:
        packages:
            - aspell
            - aspell-en
            - aspell-fr
            - jq

install:
    - bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}

script:
    - bundle exec rake

after_success:
    - ./bin/deploy-pr.sh

before_deploy:
    - bundle exec jekyll build
    - pip install --user awscli
    - aws s3 rm s3://blog.eleven-labs.com --recursive

deploy:
    - provider: s3
      access_key_id: $AWS_ACCESS_KEY_ID
      secret_access_key: $AWS_SECRET_ACCESS_KEY
      region: $AWS_DEFAULT_REGION
      bucket: blog.eleven-labs.com
      local_dir: _site
      skip_cleanup: true
      on:
          branch: master

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

cache: bundler
language: ruby
sudo: false

addons:
    apt:
        packages:
            - aspell
            - aspell-en
            - aspell-fr
            - jq

install:
    - bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}

script:
    - bundle exec rake

after_success:
    - ./bin/deploy-pr.sh

before_deploy:
    - bundle exec jekyll build
    - pip install --user awscli
    - aws s3 rm s3://blog.eleven-labs.com --recursive

deploy:
    - provider: s3
      access_key_id: $AWS_ACCESS_KEY_ID
      secret_access_key: $AWS_SECRET_ACCESS_KEY
      region: $AWS_DEFAULT_REGION
      bucket: blog.eleven-labs.com
      local_dir: _site
      skip_cleanup: true
      on:
          branch: master

after_deploy:
    - aws configure set preview.cloudfront true
    - aws cloudfront create-invalidation --distribution-id "$CLOUDFRONT_DISTRIBUTION_ID" --paths "/*"
    - curl -X POST -H "Content-type: application/json" --data '{"text":"MEP blog\n'${TRAVIS_COMMIT_MESSAGE}'", "channel": "#'${SLACK_CHANNEL}'", "username": "'${SLACK_USERNAME}'", "icon_emoji": ":'${SLACK_EMOJI}':"}' ${SLACK_WEBHOOK_URL}

Revert "Revert "chore(ci): add slack message after master deploy""
Revert "Revert "chore(ci): add slack message after master deploy""
