A middle-man based single page static website that automatically deploys to an s3 bucket via Travis-CI.
Install:
bundle install
Run:
bundle exec middleman
...and open the browser to http://0.0.0.0:4567
Any commits pushed to the master
branch are automatically built and deployed to an s3 bucket using travis-ci.
This was accomplished with a combination of:
-
Creating an AWS S3 bucket
-
Creating a new Amazon User through the IAM panel with a custom group policy locked to the bucket (note to include both the
/
and/*
permisisons) because you probably shouldn't put your main AWS users credentials in Travis (even if encrypted):{ "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:*" ], "Sid": "Stmt1383882348000", "Resource": [ "arn:aws:s3:::sheldoncalderon.com" ], "Effect": "Allow" }, { "Action": [ "s3:*" ], "Sid": "Stmt1383882349000", "Resource": [ "arn:aws:s3:::sheldoncalderon.com/*" ], "Effect": "Allow" } ] }
-
Telling Travis-CI to watch this Github repository
-
Using the travis CLI gem to encrypt the AWS user credentials as environment variables (check out the
.env.sample
file):$ travis encrypt AWS_ACCESS_KEY_ID=The0Key1Master --add $ travis encrypt AWS_SECRET_ACCESS_KEY=Your2Precious3Secrets --add
-
Configuring the
s3_sync
configuration inconfig.rb
to point to your s3 bucket. -
Commit, push, pray.