GitHub Actions

GitHub Actions

What is GitHub Actions?

GitHub Actions is a continuous integration and continuous delivery (aka CI/CD) platform that allows you to automate your build, test and deployment pipeline.

What does CI/CD achieve?

In software development, ensuring the reliability and stability of a service amidst changes and updates is paramount. This is where practices like unit testing, continuous integration (CI), and continuous deployment (CD) come into play.

Unit testing involves testing individual components or functions to confirm that they perform as intended. Continuous Integration (CI) takes this a step further by automating the testing process. With CI, automated tests run when the developer pushes a new change into the main codebase.

Once the code passes the rigorous tests set up in the CI pipeline, Continuous Deployment (CD) comes into action. CD automates the deployment of the code to a staging or development environment.

How to create GitHub Actions?

You must create a YAML file under your project's .github/workflows, here is a sample

The workflow runs an automatic test in the above sample whenever you push a new commit into the repo. Many capabilities can be achieved, such as:

  • A dedicated Test Pipeline

  • A dedicated Deployment Pipeline

  • Format, lint and type checked

  • Only triggered when the particular file is modified

  • Limited trigger when the branch is merged into the dev or prod

How to track the status?

You should be able to see the result under Actions in your repo.

Conclusion

You have a big picture of how it works now. One of the benefits of using it is that you don't have to integrate third parties, like Jenkins or Travis. You can put everything in one place and it looks neat and organized.

Happy coding!