31 Jul 2026
I used Cloudflare Workers and Pages for awhile in the past and the deployment process was nice. Commit to `git` repo, wait a bit, and then my web service will run the newly committed code. At the time, I could not use Go. There were other vendors, like Render, but at the time, they did not have data centre where I needed it, so I stuck with Cloudflare.
Then I saw a solution that allowed me to self-host the infra, so I could do similar process, but for whatever I wanted to use. I did not have the time to set it up and eventually I moved on.
Recently I learned about `git` hooks which can do what I want on my existing server. And I discovered that GitLab gives me this feature too. So far, I am impressed with how well GitLab does it - easy to set up and free.
I implemented GitLab webhooks only on one web property - the one that gets updated frequently - and, so far, it has been working out well. `git commit`, `git push`, wait a bit, and then the web property is updated.
If you are not on GitLab, Codeberg, GitHub, and BitBucket have it, too.
GitLab docs explains well the various features. For me, I only needed the `git push` hook. So I created the webhook accordingly for how I want my web app to handle it.
In particular, I need to implement the URL and the security challenges.
I then coded my web app to handle the webhook call from GitLab on the URL specified above and whatever challenge I want to implement. Then I tested it out.
I created a signaling mechanism that the server needs to process. GitLab provides the mechanism to test the webhook without actually doing `git push` on the repo - all is done on GitLab's web UI. Nice and easy.
Once the test reliably passed, next I set up the server.
Initially I was going to modify my Go app, but I learned a few tricks: shell script + cron can also do the job. (The web property does not need real time update, so cron works fine.) The key for my web app is to move some controls into the shell script, because the cron job calls on the shell script.
This setup has been running for a few days now and, so far, it's been stable. 🌻
Thanks for stopping by. Have a great day.