Learn how the deployment pipeline will work at a high level. Explore how GitHub, Travis CI, and Amazon AWS will work together to publish the site to the web.
- [Instructor] Once you've generated your site files, you'll need to host them on a server so they're available on the web. In this chapter, I'll show you how to set up a deployment pipeline using GitHub that will automatically push your site to Amazon Web Services. Here's how it'll work. First, you'll use Git to push your project files to GitHub. Storing the project on GitHub makes it easy to keep a backup of your site, and it also lets you set up services like Travis CI. With Travis CI, you'll set up a task that runs every time you change or add a file in your project.
This task will build the site files using Hugo and then push the contents of the public folder to Amazon S3. Amazon S3 will store the site files and can act as a web server too. You could point your browser directly at the S3 bucket, but it's a better idea to set up Amazon CloudFront in front of S3. CloudFront will replicate and distribute your site to multiple regions so it loads as fast as possible for your visitors. CloudFront also makes it easy to add HTTPS to your site for more security.
GitHub and Travis CI are free to use; and Amazon services only charge a few cents per gigabyte of data you store and transfer, so hosting your site this way is dirt cheap. You only need to set up this pipeline once, and after that it works automatically. Here's what you'll need to make this work. You'll need a GitHub account. You'll need a Travis CI account. You'll need a domain name, like a .net or a .com. And you'll also need an Amazon AWS account. If you don't have some or all of these things, don't worry.
I'll show you step-by-step how to set everything up. All right, let's get started.
- How static sites work
- Advantages of static sites
- Tools for building static sites
- Installing Hugo and Git
- Creating a new Hugo site
- Building a website
- Setting up a deployment pipeline
- Deploying and testing a site