This is the English version of this article.
I’ve been using my own domain since 2007, and the domain for mailing list since 2013. I have a dedicated website for them, because I send emails from there, and thought web-accessible site would be a good idea.
Originally, I had a GitHub repository hosting code, and my own server’s apache was hosting it and cached aggressively by Cloudflare.
However, deploying code was not automated, thus I had to SSH into the server, and do
git pull whenever I wanted to update the source. Also I once lost the source code, so I had to restart from the scratch. I decided to migrate to GitHub Pages because I didn’t want to do the manual pull. Anyway only resource for the site is index.html.
It is logical to think it’s primarily hosted on GitHub because it’s hosted with GitHub Pages, but its canonical source is on GitLab.com. The only reason behind this is that GitHub web editor puts themselves as a committer, which I did not like. “OK, why don’t you use GitLab Pages then?” I could use GitLab Pages, of course, but I have to upload TLS certificates on my own, and the de facto standard of free TLS certificate in 2017, Let’s Encrypt, has certificate validity of 90 days, which means I have to practically renew every two months, and then upload it to GitLab, every time I do the renewal. That was a big, big hassle for me (as I want to take less care of the project). Thus, I just decided to let Cloudflare behave as a TLS proxy, and behind them, GitHub Pages will generate HTML pages.
- Create a new ‘project’1 on GitLab.com, and create a new repository1 for GitHub Pages on GitHub.com.
- Put the source code in GitLab project, including CNAME. (Putting this in GitHub settings will mess up.)
- In the settings for the Project > Repository, set up repository mirroring to GitHub.
- In GitHub repository settings, set GitHub Pages to generate contents from
- Wait for GitLab to push to GitHub, and GitHub Pages to build the html files.
- Point Cloudflare to point at GitHub Pages.
The reason I decided on Cloudflare was I wanted to set HTTPS while using GitHub Pages. While I know Cloudflare’s Flexible SSL doesn’t do any privacy, the use case here is that the advisory wouldn’t be interested in this small website, so I just went on it.
I am seriously bad at design, so I made a website with just around 20 lines of HTML file, here.