Hacker News new | comments | show | ask | jobs | submit login
Deploying a Static Blog with Continuous Integration (loxodrome.io)
34 points by mapsnapps 8 months ago | hide | past | web | favorite | 15 comments



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/


+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).


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

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.


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


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


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.


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?


* Secure by default, you only have to keep your web server up to date or host externally

* As fast as it gets without complex caching setup

* Everything is nicely in version control instead of a SQL database (which also is used in a very messy way in case of Wordpress), edit with your favorite editor, no slow and clunky web interface with a subpar editor


There's no CMS software exposed on the public-facing end, so no need to continually monitor and install security updates the way there is with WP and other CMS-driven systems. That's not a huge thing, especially these days when WP increasingly updates itself, but if you're looking to reduce your attack surface it can be helpful.


Security and ease of deployment. If your "blog" is just a bunch of auto-generated HTML pages then there is no database to worry about or WordPress install to keep up to date. You won't get hacked because you installed a plugin with a bunch of bugs in it.


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...).


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.)


Another option, ICYI is Aerobatic

https://www.aerobatic.com

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

Disclaimer: I work at Aerobatic.


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,..."


Oops, fixed :p




Applications are open for YC Summer 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: