Setting up GitHub Pages to use on Parking domains using GitLab

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.

  1. Create a new ‘project’1 on GitLab.com, and create a new repository1 for GitHub Pages on GitHub.com.
  2. Put the source code in GitLab project, including CNAME. (Putting this in GitHub settings will mess up.)
  3. In the settings for the Project > Repository, set up repository mirroring to GitHub.
  4. In GitHub repository settings, set GitHub Pages to generate contents from master branch.
  5. Wait for GitLab to push to GitHub, and GitHub Pages to build the html files.
  6. 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.

 


  1. Project in GitLab == Repository in GitHub, if you didn’t know. 

One Reply to “Setting up GitHub Pages to use on Parking domains using GitLab”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s