AWS CodeBuild, being one of the services within the suite of CI solutions by Amazon Web Service (along with CodePipeline, CodeDeploy, and CodeCommit) is a common choice for CI needs among projects that are ultimately deployed to the AWS Cloud.
GitHub on the other hand, started as a Git repository as-a-service, but evolved beyond that since these early days, and is now offering a CI solution of its own – GitHub Actions.
Although offered by different companies – they both satisfy the same requirement – to set up a CI/CD pipeline for your company’s project. Also, they both work for projects that are just getting started or ones with thousands of contributors.
In this article, we’ll try to shed some light on how these two services compare in terms of cost when used on a real-life scale.
Free Tier comparison
AWS CodeBuild includes 100 free build minutes per month for a CodeBuild job, based on the “general1.small” type, which includes 2 vCPUs, 3GB of memory, and 64 GB of disk space, as per the documentation.
GitHub Actions includes 2000 build minutes per month, and the hardware of each job is fixed to 2 vCPUs, 7GB of memory, and 14 GB of disk space, as per the documentation.
Real life example
Let’s assume developers are committing to your project’s repository, on average, 20 times per day, triggering a CI run, and each build takes, on average, 15 minutes to complete. This brings us to 9000 build minutes per month (20x15x30).
Comparing the CI costs for running the same CI pipeline on GitHub Actions vs AWS CodeBuild, the difference, from a cost perspective, would be:
- First 100 minutes from the free tier are consumed
- The remaining 8900 minutes are charged at $0.005 per minute
- Total cost: $44.5 per month
- First 2000 minutes from the free tier are consumed
- The remaining 7000 minutes will cost you $0,008 per minute
- Total cost: $56
Of course, the decision whether or not you should use CodeBuild or GitHub Actions is rarely based purely on price. There are other factors that come into play, including flexibility, integration with other services your project uses (e.g. other AWS services), observability (how easy it is for your developers to inspect build logs), scalability, parallelism, etc.
For this reason, I can not highlight one service as being superior to the other. We, at ScavaSoft, use both AWS CodeBuild and GitHub actions for our internal projects. We use GitHub actions mostly for lining and unit testing operations, whereas for Continuous Deployment to production environments – we rely on AWS CodeBuild and CodePipeline’s tight integration with the other AWS services like CloudFormation.