TravisCI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- 6 | |
cache: | |
directories: | |
- vinhlh.static/node_modules | |
install: | |
# for invalidating CloudFront distribution | |
- pip install --user awscli | |
script: | |
- cd vinhlh.static | |
- npm install | |
- gulp | |
before_deploy: | |
- cd dist | |
deploy: | |
provider: s3 | |
# access, secret keys, region are configured in TravisCI backend | |
access_key_id: $AWS_ACCESS_KEY_ID | |
secret_access_key: $AWS_SECRET_ACCESS_KEY | |
region: $AWS_DEFAULT_REGION | |
# will be uploaded to this S3 bucket | |
bucket: $AWS_S3_BUCKET_NAME | |
# prevent Travis CI from deleting build artifacts | |
skip_cleanup: true | |
on: | |
branch: master | |
after_deploy: | |
# allow `awscli` to make requests to CloudFront. | |
- aws configure set preview.cloudfront true | |
# invalidate all objects in the CloudFront distribution | |
- aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment