This is the source for my personal website at https://parsiya.net.
- Create a new post with
hugo new post/2018-11-23-post-name/index.markdown(or
index.md) because I like page bundles.
- Edit the post and proofread with
hugo serve -v. Pictures are added in the same directory to take advantage of page bundles.
- Push to Github.
- Travis CI takes over and publishes the blog.
- See Travis CI section.
- s3deploy deploys the blog to AWS and invalidates the CloudFront cache for updated resources.
- See s3deploy section.
- Profit. The website is now updated. Add CI/CD to your resume.
The website is hosted in an S3 bucket. CloudFront provides CDN and TLS.
My .travis.yml is very simple.
- The theme is a submodule. It's updated first.
- Install two debs. Hugo and s3deploy. I like to control the versions as both software are under heavy development.
language:minimalreduces build time by 20 seconds (compared to the default container).
- AWS key and secret are in
AWS_SECRET_ACCESS_KEYrespectively. These are used by s3deploy.
deploy.bat does the same thing for manual deployment.
Static resources (fonts, images, css, etc.) are set to never expire. Everything else is set to use gzip compression. When a resource is updated, s3deploy invalidates its CloudFront cache.
Note: If you enable
gzip compression for Keybase proofs (see static/keybase.txt), the proof will break.
Use the s3deploy's example IAM policy. AWS does not support addressing separate CloudFront distributions with ARNs (Amazon Resource Names) so the resulting key can list and invalidate all distributions.