loading...

Discussion on: Where should I host my static website?

Collapse
lietux profile image
Janne "Lietu" Enberg

Two options I really recommend nowadays:

  • GitHub Pages: Free, Let's Encrypt enabled, hassle free, just works.
  • Google Cloud Run: Really cost-efficient, extensible later with backends, etc., Let's Encrypt enabled

With Google Cloud Run you have to set up a build pipeline to build a Docker image and push it to the Container Registry and release to Cloud Run automatically, but this is not a lot of work, and you can use Travis-CI, Google Cloud Build (120min/day for free, afterwards really affordable), etc. to take care of it automatically.

Cloud Run isn't "serverless", but nothing really is, there's just varying degrees of what control you have over the servers in question. In case of Cloud Run it uses Dockerized containers and Google takes care of automatic scaling, load balancing, fault recovery etc. completely. For most use it's going to be incredibly cheap, as long as you're not hosting like big video assets and such there and have significant traffic.

Collapse
lietux profile image
Janne "Lietu" Enberg

Oh and in case of GitHub Pages I typically still use some tool like Hugo, Gatsby, or something and Travis-CI to build and release the results to GH Pages.

Collapse
dsteenman profile image
Danny Steenman Author

GH Pages sounds like a doable option! I'm wondering; do you deploy the "public" build folder in a separate repo or keep it in the same repo?

Thread Thread
lietux profile image
Janne "Lietu" Enberg

Sometimes separate, mostly the same and just use gh-pages branch, depends a bit on what I want from the end result - if you don't use custom domains GitHub Pages hosting can lead to very funky URLs sometimes unless you deploy to specially named repos.

Collapse
rizary profile image
Andika Demas Riyandi

Can we use CDN for the app running in the cloud run?