This is my .travis.yml:
deploy:
provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: domain.com
skip_cleanup: true
acl: public_read
region: ap-northeast-1
endpoint: domain.com.s3-website-ap-northeast-1.amazonaws.com
detect_encoding: true
on:
branch: master
But it is only upload files to bucket, not sync. How can I sync or clear S3 bucket files?
To solve this I installed the AWS cli from pip and executed a before-deploy script.
This is what you need in your .travis.yml:
You also need to secure two environment variables inside your .travis.yml which is ready by aws-cli:
Your bin/deploy.sh should look something like the following
Not that we specify the region, which seems mandatory for aws cli here.
Hope this helps!