Skip to content

Instantly share code, notes, and snippets.

@vinhlh
Last active February 28, 2017 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinhlh/eba5567d4eba7426668962c4401b3fdb to your computer and use it in GitHub Desktop.
Save vinhlh/eba5567d4eba7426668962c4401b3fdb to your computer and use it in GitHub Desktop.
TravisCI
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