Hosting site on GitLab with CI/CD

personal GitLab CI/CD

The last blog post was made more then 2 months ago, since then a lot has happened. In this article I wrote about why I haven’t wrote any post since then, and how I overcame the problem.


What was the problem

Firstly, I had a lot of content around my mind so it was easy to write about them. I also enjoyed this whole jekyll stuff which contains writing the articles, compiling it with Jekyll, check the outcame locally in the browser and iterate this process until the given article is not ready. …and if everything is good to go then upload the files to the server via FTP. And this is what the problem was: uploading the files.

Basically I wrote 2-3-4 articles in one run, then build it with jekyll and then upload it. If I do this once, no problem. But doing it for every article; or (worse case) for everytime when I change something, it becomes annoying…

Currently I have https://siposm.hu hosted on “simple old” server with FTP access only, which means no git, no bash scripting, no nothing. I can use MySQL with PHP and a lot of administrative features, but this is the tech stack – which is more or less enough for me by the way.

So I needed automatism in the process. Of course I have to write the article; but the deployment part of the work could be automated.

What has happened

In the past I already used GitLab page hosting (called GitLab Pages), but since I had my own domain name with dedicated storage space I moved the content there. I prefer this way because then I use purposefully the domain. (Why have mysite.com domain if you use mysite.gitlab.io instead…) But the problem still around: building and deploying the site.

Until I don’t rent a VPS (Virtual Private Server) where I can do whatever I want I’m going to use GitLab’s page hosting. It’s good because I can use GitLab’s CI/CD to build and run the jekyll site’s content – which previously was a pain as I described previously above.

What’s next

I’m planning to move from hosting to buying a VPS and deploy my sites there instead. This also can be connected with GitLab’s CI/CD, so it should be a good way to go – at least I hope so.

For future updates follow me on Twitter.

About GitLab Pages

So just a few words I think should be mentioned about this whole concept… which is great! In many cases developers want to have a website about their work/hobby/etc., so with this it is free to use and free to host. Apart from being free the other advantage is the git version control feature – which for me is a key advantage over FTP uploads!

In the image below the concept and workflow can be seen about the page hosting.

gitlab_workflow

Details can be found on the official site, so check out for more information.

Update 2021 january

I moved this whole concept to GitHub, as well as my other repos. Ps: Jekyll hosting on GitHub is drastically faster, which is a huge thing considering every build/deployment takes time to see the outcome.

Feel free to check me there. 👌🏻