GitHub has introduced the ability to execute custom workflows for events you generate within GitHub using GitHub Actions. For instance, using this functionality, you can implement CI/CD using GitHub’s infrastructure itself. No need to subscribe for a special service to build/test and deploy your application, but rather these can be done in GitHub itself, with the actions defined by us, or the extensive list of actions already available.
Ballerina has also implemented its own GitHub Action by allowing the Ballerina CLI commands to be accessible as an action. The Ballerina GitHub Action lives in this repo. You will be able to find examples there on its usage. GitHub Actions are at the moment in beta status, and you have to request for an invite in order to use it. If you already have access, great, please give it a try. For others who are interested in seeing it in action, I have created a walkthrough video with some patterns on how this functionality can be used. The scenarios consist of Ballerina applications, that will build/test/deploy automatically with each git commit/push. The deployment scenarios that we will be looking at are:
- Ballerina Kubernetes Deployment
- AWS Lambda Deployment
- Ballerina Module Deployment to Ballerina Central
The samples used for the above demo can be found in the below locations: