A demonstration of a very simple static site generator that deploys to S3 through Travis CI.
Install Go 1.6+, then:
go get -u github.com/ddollar/forego cp .env.sample .env # Compile Go executables. make install # Run an initial build of the site, look for build output in public/. forego run make build # Watch for changes in Go files and/or content and recompile and rebuild when # one occurs. forego start
The repository will deploy to S3 automatically from the Travis build when changes are committed to master.
This works by having encrypted variables configured in
.travis.yml for an IAM account with privileges to the production S3 bucket.
These credentials can be reconfigured with:
gem install travis travis encrypt AWS_ACCESS_KEY_ID=... travis encrypt AWS_SECRET_ACCESS_KEY=...
Deploy locally by first making sure that you have awscli installed:
pip install awscli
Then set appropriate AWS keys and go for it:
export AWS_ACCESS_KEY_ID=... export AWS_SECRET_ACCESS_KEY=... export S3_BUCKET=singularity.brandur.org make deploy
Dependencies are managed with dep. New ones can be vendored using these commands:
dep ensure -add github.com/foo/bar