Skip to main content

So I have learnt github action

So I have learnt about GitHub action.

Well I didn't learn it voluntarily, since I was thrown into the SDK team temporarily in my company and their travis credit has run out, but hey it really is useful!

Yes the debugging procedure can be annoying, as it is proven by my colleague, but when it works, it is so bloody satisfying!

How did I get into it?

It was actually a rather interesting story. In my company, the key developer and maintainer for our SDK library has quit last year, and throughout the year he quitted, we had developed a new API for a completely new service. Whilst I am the only key developer for the backend and design of new service, there is only one developer left to update our library across all languages.

Having only me to do both coding and API design documentation for the same product had led me producing a finalised version of API documentation till quite late of the development stage, which kinda screwed up my poor colleague that has to learn all the language and write the SDK at the same time.

In the end, our service has launched before SDK is fully ready, and the SDK guy cried for help. Since I am the one most familiar with git and the new API itself, our senior suggested him to seek help from me.

Sure, I already have quite a lot of complains about our SDK state after the last SDK guy who setup everything has left, so I picked up the languages I had learnt in the past and helped in completing the test case and debugging before publishing. To my horror they sent me their code in zip file through google docs. What on earth is going through their mind when you made an open source library but you develop new API through google doc??

Naturally the first thing I did was to branch out and create PR so that I can make use of the CI/CD tools to see how much I need to do. Everything went well until, of course, the travis credit ran out. Nice.

Is this why they don't push their code to GitHub before to save travis credit? Of course not! You should be still able to do basic versioning through local git or even SVN, but I get a zip file instead. Also, none of us are aware of travis is now running on limited credit until it had stop working. I'm pretty sure the pileup of dependency bot PR and README file (that are being edited directly from the GitHub site for some reason) doesn't help. Anyway, the credit was sure ran dry after I had pushed the code onto GitHub repo.

After some back and forth on how to get more Travis credit with the higher ups but to no avail, we almost ditch the effort to run test case on CI and all, but through some miracle, my colleague has managed to get in tough of the previous SDK guy and he recommended using GitHub action for their monthly free build credit.

What a brilliant idea.

The pursue of GitHub action

It didn't went well at first, as no one has experience in it, and the syntax is quite different from the travis build we had setup before. But very quickly, I had managed to get hold of it purely by the brute force method of "how I do it in shell". This is where I started taking the lead, as my colleague has had his workflow mainly through a GUI, even though he knew what is going on behind the scene, he does not know the series and sequence of command that has to be typed in.

He went through the process of using searching and setting up applications just to run our test case. Yes there are tons of application out there, but not all of them are well documented, and most of them are much more complicated than just typing the command in a shell. As it turns out, our simple simple that only requires us to install it in the test environment, run the test cases, and upload the test code coverage doesn't need much application to run them through.

So what am I going to do with this knowledge?

You see, I am still self hosting this entire blog, which are essentially just static page generated by Nikola. Now that the server is behind Cloudflare CDN, I lost my precious HTTP 2 functionality that they don't provide for free in return for some statistics on where my major viewer might come from. Turns out, people who reads this blog is far outnumbered by crawlers that are trying to scrape my non-existence content.

I am planning to migrate it to Github page. I mean, I maintain the backend of the blog through git, and push it to GitHub before I pull it again at the server for building the output, might as well make use of it right?

For this purpose I have actually reworked on part of the installation bits and publish it through gh-pages branch. It works quite well actually, just that I have yet to change the DNS settings to it.

Now we wait for the time for me to escape from procrastination and dig more into GitHub pages before doing so, you know, just in case it breaks anything.