Behind The Scenes: Edition 1 - Deploying Static Sites
So in the gif below, we create a markdown file and then we fill in the file with the information about the post, the title, excerpt, date, and the categories. We’re putting that info in the front matter which is read by jekyll when it is building the static site out.
After we’ve finished editing the file, we commit it and push it to Github. Our travis.yml
file allows the pushes to Github to be picked up and sends the files to our S3 bucket.
.travis.yml file looks like this:
We specify ruby version 2.4.1 and some steps to run in the virtual server that Travis CI spins up. We first install the dependencies of jekyll using bundler. We then install a handy gem, s3_website which pushes all of our files to S3 and handles Cloudfront invalidation as well. We then run a script to build the site, we push to S3 and bingo, our changes are live!