Jenkins vs GitHub Actions Which is better?
Comparing Jenkins to GitHub Actions
In the world of DevOps there are many tools, best practices, and acronyms. Two such acronyms, that are often combined, are CI/CD. A CI/CD software allows developers to automatically build and test (Continuous Integration), as well as package and deploy (Continuous Deployment). That is the basic premise behind all CI/CD software. There are applications and services out there that differentiate themselves with additional features. I will be looking at two such pieces of software, Jenkins and Github Actions.
In the next sections I'll have a brief description of each software, a comparison, and a finally a conclusion.
Jenkins was initially released in 2011 and has an even older history under another name, Hudson. Jenkins is the de-facto standard for a self-hosted, open-source CI/CD solution. Any software that has a long history comes with user experience, if anything needs to be done you can be sure that someone has done it. But it also comes with rough edges, legacy code, and the need to maintain legacy features. There are vastly different installations, and setups of Jenkins out there. It must be self-maintained so when a new version is released, most people self-hosting will not upgrade immediately. That assumption is highly probable for a company self-hosting Jenkins.
However, if you are willing to keep your instance of Jenkins up-to-date, then you will find that Jenkins has kept up with the times. A minimum requirement of Java 11, a regular release cycle, a strong community, and a standard file based approach to creating pipelines (Jenkinsfile) all point to the fact that Jenkins is a great open-source option for CI/CD.
GitHub Actions is relatively but has same basic premise, allow developers to continuously build, test, package, and deploy their software. Of course this is a proprietary service provided by GitHub, but if all your source code repositories are on GitHub then Actions is a compelling offering. It is well integrated into GitHub and the various events and checks that GitHub has. With GitHub actions you don't need to poll for changes to deploy anything, everything can be event based. Pull requests can trigger test pipelines that can provide feedback directly on the pull request whether the tests passed or not. While external solutions would need to gain access to your GitHub account or use web-hooks to achieve a similar experience, you get that for free with GitHub actions.
Even though it is new on the CI/CD stage, GitHub Actions has gained a lot of community support. Simply doing doing a search on Github marketplace yields over 14,000 actions that others have created. Anyone creating pipelines with GitHub Actions can find a community created action that will servce their purpose. Everything from deploying a web app to Kubernetes to publishing an updated to an Android application, can be found on the marketplace.
Comparison
Features
While both Jenkins and GitHub Actions provide the basics of CI/CD here are some differentiators for each. This is by no means an exhaustive list.
Feature | Jenkins | GitHub Actions |
---|---|---|
Version Control | Git, Subversion,Mercurial, and others | Git |
Number of plugins/actions | 1800+ | 14000+ |
Scripting language | Groovy | YAML |
Custom agents (Servers) | Yes | Yes |
Open-source | Yes | No |
Language support | NodeJS, Java, Python, and more | NodeJS, Java, Python, and more |
Value
Ultimately the adoption of a tool depends on how much value that tool provides. In the case of both of these tools, let's have a look at a scenario of how much it would typically cost to make regular use of these tools.
The recommended hardware for a small team's Jenkins controller node is 4+ GB of RAM and 50+ GB of drive space. If we take a DigitalOcean droplet of that size, it comes out to be about $24 USD/month. There are no controller node worries for GitHub actions so the cost there is $0.
Now let's add an agent to the architecture. Let's suppose we only have NodeJS projects. We want a minimum of 1 GB of RAM to be able to install and build our dependencies. That mean out Jenkins setup is costing an additional $6 USD/month. While you get 2000 free minutes every month with GitHub Actions. That's 33 continuous hours of builds. GitHub charges $0.008 USD/minute for additional time used for builds. You get 1000 extra minutes for $8 USD/month.
So while the Jenkins install is costing roughly $30 USD/month, for a small team, the GitHub setup might not be costing anything. Where this starts to have diminishing returns is on later tiers of GitHub. If you have a teams plan from GitHub it will cost you $4 USD/user/month. In this plan, as your team grows to 8 or above you have surpassed the cost of the Jenkins setup. At that Jekins could be used 24/7 and still cost that same where as if Actions is used 24/7 the cost will only increase. GitHub does provides ways to mitigate those increasing costs. Just like with Jenkins anyone can bring in their own agent nodes. These self-hosted runner nodes can be added to repositories, organizations, or enterprises. With this the cost of running 24/7 will be less than Jenkins, but you still have to pay per user if you want the teams plan. You can always use the free tier with a self-hosted runnner, then the costs are much more controlled.
Conclusion
In the end your choice of CI/CD tool may depend on features, or cost, but it also depends on your values. If you are an individual that values open-source, likes to tinker, and want to control your own infrastructure, then Jenkins is still a great option for you. If you are an individual or a corporation that wants to control costs, has all their code in GitHub anyway, then GitHub Actions is a no brainer.