
Deploying a Static Blog with Continuous Integration - mapsnapps
https://www.loxodrome.io/post/hugo-on-ci/
======
michaelmior
Netlify[0] is the best solution I've found so far for my personal site. It's
specifically designed for this purpose. One of the nice features they have is
the ability to set headers on different pages as well as proxy certain paths
to external services via configuration files.

[0] [https://www.netlify.com/](https://www.netlify.com/)

~~~
jtrevner
+1 for Netlify. I've been using it for a few months for my personal site. It
took me maybe 10 minutes from creating an account to going live with SSL from
a GitHub repository. I brought it work with me, using it to host a React
prototype (and hopefully, eventually, production).

------
daveguy
For a single provider solution GitLab pages has built-in CI and hosting.

[https://gitlab.com/pages/hugo](https://gitlab.com/pages/hugo)

They have gitlab-ci.yml files for most of the static page generators. Whether
you use Hugo, Jeckyll, Pelican, etc there is a ci config to start with
virtually no setup overhead for hosting or ci.

~~~
relaxitup
Didn't know about this. Very cool, thanks.

------
kkapelon
An even simpler solution is to use github pages. So no CI needed at all. You
push your changes and Github is doing all the work on its own. You get the
final result as html.

No ssh keys, no circle CI, no environment variables. Just git push

------
sandGorgon
A brilliant solution to deploy static website is using Firebase Hosting. Works
brilliantly - provisions free certificates, and is fairly easy to do.
deployment is a question of writing a json file and using firebase cli to run
deploy. You get all the advantages of Google CDN, etc. Also a cool feature is
rollbacks, where you can go back to a previous version of the website.

The biggest problem is firebase cli - I really wish they had built a static
binary using golang (firebase is a Google division after all). The
dependencies in firebase cli are sometime broken, etc.

------
Animats
_Although the site generation software here is Hugo it could easily be another
provider such as Jekyll. The web server will be hosted on a Digital Ocean
droplet running Nginx, and CircleCI will be used for for the continuous
integration (often abbreviated to simply “CI”)_

It's just a blog. Why is this better than running Wordpress, perhaps with a
caching server in front if the traffic is heavy enough?

~~~
giobox
Another advantage is you can put your _entire_ website on a CDN provider like
Cloudflare, because the whole site is static. This means my server can die
completely, but Cloudflare can still keep on serving my site, and my readers
have no idea of my ineptitude.

You can do this even with Cloudflare's free tier - no need to rely primarily
on adding more VPS instances/load-balancing to 'scale' your static site - the
CDN can help take care of this. I've recently moved my Jekyll based blog to
the cheapest VPS instance I could find, and use CloudFlare to handle the load
(not that it has much in the way of readers...).

~~~
rgbrenner
be careful relying on that though.. Each pop has it's own cache, and when
there's a miss, it'll hit your server.

Its pretty rare that a CDN gives you any insight into their caches, and
there's no guarantee a file is kept in the cache. A file can be removed from
the cache for many reasons--cache filled; file not popular enough; etc.

So even if your local pop is saying the file is cached.. the other pops may
not have any files for your website at all... or might be missing parts of the
page (images, etc). (The x-cache header only indicates the status of the file
at the pop that served the request -- not all pops.)

------
jgowans
Another option, ICYI is Aerobatic

[https://www.aerobatic.com](https://www.aerobatic.com)

The new themes gallery has you live in less than a minute.

Disclaimer: I work at Aerobatic.

------
SagelyGuru
I don't mean to be pedantic but I do get confused by people writing about
tenants and building in one sentence, when they probably meant tenets?

"...we can leverage another one of it’s key tenants, which is that the
building,..."

~~~
mapsnapps
Oops, fixed :p

