DEV Community

GitHub Webhook CI/CD: Step-by-step guide

Youssef El Idrissi on February 04, 2025

(This Blog post is part of a collaborative work between Me and Mustapha El Idrissi, Consult his devTo page for more information: https://dev.to/ap...
Collapse
 
ttsoares profile image
Thomas TS • Edited

Why this is better (or not) that configure Vercel (or any other) to keep an eye on a repo and if a push did happens Vercel (or any other) take the new code and restart the application with the new version ?

Collapse
 
0xw3ston profile image
Youssef El Idrissi • Edited

Funny thing is that this method is already inspired by How Vercel, Heroku and Cyclic handle this sort of stuff, so it's neither better nor worse, it's actually the same exact method.

I personally still to this day prefer to work with IaaS instead of PaaS in order to learn more stuff especially things that are DevOps or System design focused, and as you know, IaaS does not offer this sort of stuff by default unless you implement it yourself (like the code/guide shown above).

Furthermore this blog just demonstrates how you could achieve the same exact thing Vercel offers but on your own machines/servers.

And as a bonus there could be some other custom logic that you could add to this (or these) webhook handler (unlike PaaS like Vercel where you don't really get much control about what happens when the "new commit" repo webhook gets triggered)

I hope I didn't complicate the explications too much and if you have any more questions let me know :)

Collapse
 
ttsoares profile image
Thomas TS

Agreed.
My personal issue is that I dislike Micro$oft very much since Windows 3.11...
Have been using GNU/Linux since 1992.

Thread Thread
 
0xw3ston profile image
Youssef El Idrissi

It's quite an honor to be speaking to someone that had at the very least ten times the amount of experience I have, and yes I do agree that Linux is much much better if you're in the IT field, it could only pose some limitations if you're mostly a consumer, like the case in video games etc.

I almost always get a head migraine before I setup a server/service on Windows, whereas in Linux things are a lot more straightforward

Not to mention the fact that Open Source projects are far more admired than Closed source ones.

Nowadays Windows is just a collection of bloatware.

Thread Thread
 
ttsoares profile image
Thomas TS

You are welcomed :-)
I'm now far away from the gaming context. Even though have a simple desktop with Win 10 just to run Unreal Tournament III, kind of old school first person shooting.
Nowadays, one can see lots of YouTube videos with some savvy person teaching some IT subject and, most often than not, they use a Apple Mac hardware. As with Micro$oft, IOs is a cesspool of spyware and all sorts of 'big data' gathering.... Second only to my family, I love liberty and privacy. So, Free Software is the best way - not ideal though as there are tales of "infiltration" - like the systemd one.
Recently I migrate to the MX Linux distro that uses sysV init instead systemd...

Collapse
 
manchicken profile image
Mike Stemle

This is a very good post.

Collapse
 
0xw3ston profile image
Youssef El Idrissi

Thank you :)

Collapse
 
doertemithut profile image
DoerteMitHut

Amazing! I spent Sunday doing a very similar thing wondering what would be the advantages and drawbacks of the various ways to tackle this. Great to see there's others who are interested in this.

Collapse
 
0xw3ston profile image
Youssef El Idrissi

Thank you, to be frank I took inspiration from Heroku and Cyclic, they're PaaS services that offer hosting. What made me take interest in this specific method is its simplicity and also the fact that it eats very little resources, so no additional strain is put on the server.

Collapse
 
razielrodrigues profile image
Raziel Rodrigues

I will take a look!

Collapse
 
okayiy profile image
Okon Inyang

Thank you, Youssef.

Collapse
 
0xw3ston profile image
Youssef El Idrissi

You're welcome :)

Collapse
 
mkarthiatgithub profile image
Karthi Mahadevan

nice, we use gitlab and similar way , we use gitlab webhooks and audit events.
Do you have any other scenarios where this will be useful ?
we monitor all user actions with these events.

Collapse
 
ilyas_08 profile image
Ettourach

great presentation!! SO what is the main raison to do this steps