Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Hugo to AWS S3 Deploy Command

Code

TODO: Figure out why this isn't working in MDX


Here's a quick snippet of code to put your shell aliases file that cds into your Hugo directory, builds the site, deploys it to AWS S3, and then invalidates the cache. 


	function hugo-deploy () {
	    cd /path/to/hugo/site
	    hugo
	    aws s3 sync /path/to/hugo/site s3://your_site_s3_bucket/
	    aws cloudfront create-invalidation --distribution-id AAAAWWWWWSSSS1111 --paths "/*"
	}