3 ms·
Cool! I could see why this would work well for teams and collaboration. Here's my hugo+aws pipeline for my personal blog. Do editing, with hugo in server mode
by tfolbrecht 9y ago
Cool! I could see why this would work well for teams and collaboration.
Here's my hugo+aws pipeline for my personal blog.
Do editing, with hugo in server mode so I can WYSIWYG edit my pages. Then run a bash script:
#!/bin/bash
# build site from markdown + template
hugo ~/sitedir/
# post to S3 bucket which is a file storage service
aws s3 sync ~/sitedir/public s3:sitedirbuckket --recursive
# invalidate CDN distribution so content delivery is nice and fresh!
aws cloudfront create-invalidation --distribution-id XXXXXXXXXX --paths /*
echo -e "All done"
- ianhowson 9y agoThis is almost line-for-line my setup. I like the CodeBuild solution for the times when I'm editing on my phone or a shared computer. I push to GitHub, and CodeBuild handles: * build (as above, plus asset processing and minification) * deploy (s3 sync, plus some fiddling to add 301 redirects) * ping search engines I keep a lot of drafts and temporary notes in my local checkouts and doing build/deploy on a fresh checkout helps to ensure they don't slip onto the public website.
- cirowrc 9y agoHey, thanks for sharing your setup. What's this thing about `ping search engines`?
- tfolbrecht 9y agoTo refresh the crawled cache the search engines have. I've never given it much thought, but I guess it would be refreshed when queried. I will add it to my bash script for funzies. Here's the implementation in the sister comment: https://github.com/thom-nic/jekyll-s3_deploy/blob/master/lib/jekyll/s3_deploy/ping.rb https://github.com/thom-nic/jekyll-s3_deploy/blob/master/lib...
- thom_nic 9y agorelated: I wrote a plugin to do the same for Jekyll, although it does not (yet) do cloudfront invalidation: https://github.com/thom-nic/jekyll-s3_deploy https://github.com/thom-nic/jekyll-s3_deploy
- tfolbrecht 9y agoLooks good. gzip is implemented on cloudfront instances via a flag, so you can kill two todos by implementing it! I wonder how much cool stuff you could add to this build gem. Minification, staging, SCSS, etc.
- thom_nic 9y agoDoesn't Jekyll already handle minification and CSS preprocessing?