BTS changes

NEW personal GitHub

Behind the scenes there were a few – absolutely not necessary but good to have – changes regarding this website / blog. In this post I’ll summarize them.


Old process

v1

The previous version was more or less a simple, not automated system. The source code was of course version controlled using Git, but then the deployment part was manual. This part was very annoying, because I always had to open an FTP client, login, browse to the needed folder, open a local browser, find the new / modified files, drag them for upload, confirm override and only then, after all these steps it was ready. Oh and I almost forgot, there was also a step where I had to build the code itself and had to wait the build process. This is at least 8 steps which you do not want to do everytime for sure.

Since the storage provider a simple FTP based option I had to adapt to this system.

v2

A bit later I started using GitHub pages (or GitLab pages, depending on what I’ve used more often) but my problem was that I bought my personal siposm.hu domain, and simply ignoring it just because GitHub pages can offer the website to be hosted on something like xxx.github.io was not in my favor. Of course the bought domain can be redirected via a small header("Location: blabla") line of code, but then again the user is seeing the github.io domain in their browser.

New process

v3

Then I moved to a next level, where I modified the provider’s DNS records and redirected each request at the DNS level (not from code, like above). Then at GitHub I set this domain to be connected with the wanted-to-be hosted repository of mine.

With this change I mixed the good parts of the two versions:

  • I don’t have to manually upload the files via FTP
  • meanwhile I’m still able to use my bought personal domain

The image below shows exactly that this extra step is now replaced with a CI/CD automatic process. It also has some good advantages, because only the master branch will be deployed, so until a given article is not ready I can use a separate feature branch for that, and only PR/merge it into master after it’s ready.

process

GitHub custom domain setting

In order to redirect all requests from yourdomain.com to GitHub pages, you have to modify the DNS records provided by your provider. In this official article the steps can be read.

In my case I had to login to the admin panel, select DNS maintainance and modify the www subdomain to CNAME type and add siposm.github.io as a hostname, then save and wait a bit until the new settings take place.

Then I went over to the GitHub repo’s settings, added the new custom domain under settings, and it was good to go.

With these adjustments now I simply can create a new article locally, version control it as I wanted (eg. creating a new feature branch for that, working on it independently and only if it’s done publish it with a PR to master) and with a git push command it’s automatically built, published and deployed.