Boilerplate for a static site repo that's deployable to S3
- README.MD (this)
- public/ (everything under here will be uploaded to S3)
- assets/
- javascripts/
- stylesheets/
- index.html
- create an S3 bucket with the same name as the route (ie: elections.laist.org). Bucket name and URL must match.
- set the S3 bucket policy like so (replace
YOURNEWBUCKETNAME
):{ "Version": "2012-10-17", "Statement": [ { "Sid": "AddPerm", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::YOURNEWBUCKETNAME/*" } ] }
- set the property of that S3 bucket to serve static websites
- rename the file in
.circleci/
fromconfig.yml.example
toconfig.yml
- remove these lines from
config.yml
if not using Cloudfront:- run: name: Invalidate Cloudfront cache command: aws cloudfront create-invalidation --distribution-id $DIST_ID --paths "/*"
- create or update the IAM policy for Circle CI to have control over this newly created bucket
git push
this repo to master to get it to show up in Circle CI- log into circleci.com, click on this newly created Circle CI project from this repo
- click the 'settings' cog at the top right for the project
- scroll down to 'Permissions' and enter in the AWS keys
- scroll up to 'Environment Variables' and add the following:
- BUCKET = [your newly-created bucket]
- DIST_ID = [cloudfront distribution id] (optional)
- click back to the project page and select "rebuild" to rebuild with the new settings.
- copy
sample_readme.md
into the realREADME.md
for the project repo. Fill out relevant parts.
Create an issue in this repo. Star this if you've found it helpful.