Original post is here: eklausmeier.goip.de
I wrote about hosting static sites on various platforms:
- Hosting Static Content with surge.sh
- Hosting Static Content with now.sh, now.sh renamed themself to vercel.app
- Hosting Static Content with netlify.app
- Hosting Static Content with Cloudflare
- Hosting Static Content with Neocities
- Hosting Static Content with GitLab
- Hosting Static Content with GitHub
DigitalOcean offers what they call "App Platform". It is a "Platform-as-a-Service (PaaS)". They have "apps" for React, Django, Go, Jekyll, Next.js, Python, Ruby, Hugo, TypeScript, Hexo, PHP, Node.js, Gatsby, and some others.
Here, I confine myself to the "Sample App for Static HTML Assets". I only show how to use GitHub as source for static files. GitLab would be totally similar.
1. Steps to setup. Here are the steps to create a static site on DigitalOcean.
- Go to "App Platform"
- Click "Create App"
- Select one of the repositories, GitHub in this case
- Provide access to your GitHub account, if you haven't done so
- Choose proper GitHub repo
Whenever changes in the GitHub repo, or you change the settings in DigitalOcean, you initiate a new build.
Unfortunately, the name used for DNS, here eklausmeier-5257s.ondigitalocean.app
cannot be changed.
It is partly autogenerated.
2. Build configuration. The default build configuration for static sites is:
1lerts:
2- rule: DEPLOYMENT_FAILED
3- rule: DOMAIN_FAILED
4features:
5- buildpack-stack=ubuntu-22
6ingress:
7 rules:
8 - component:
9 name: eklausme-github-io
10 match:
11 path:
12 prefix: /
13name: eklausmeier
14region: fra
15static_sites:
16- environment_slug: html
17 github:
18 branch: master
19 deploy_on_push: true
20 repo: eklausme/eklausme.github.io
21 name: eklausme-github-io
22 source_dir: /
3. Limitations. DigitalOcean does have some annoying limitations. My blog cannot be fully hosted on the DigitalOcean app. If I remove all images then DigitalOcean can host it. So it seems there is some undocumented limit on the number of files.
In the free version you can only have up to three apps.