Join us
@ganapathisubramanian ・ Jul 04,2022 ・ 2 min read ・ 877 views
Continuous Integration is one of the renowned mantras in the DevOps + agile environment. It is a DevOps practice where developers/engineers regularly merge their code changes into a central repository, and it is built and tested automatically.
Continuous Integration is one of the renowned mantras in the DevOps + agile environment. It is a DevOps practice where developers/engineers regularly merge their code changes into a central repository, and it is built and tested automatically.
Benefits of continuous integration:
Tools for continuous integration:
There are many tools for CI. Some of the popular tools are:
As a part of my DevOps learning journey, I came across GitHub actions and I am happy to share my understanding of them here.
GitHub actions:
It is a continuous integration and continuous delivery (CI/CD) platform that automates the build, test and deployment phases. It goes beyond the standard CI process and allows you to configure the workflows such as automated labelling for new issues created in the repository. This workflow can be executed in a GitHub-hosted environment called runners or self-hosted runners. It supports Windows, Linux and macOS virtual environments.
Components of GitHub actions:
Enough theory, let’s play!
Before getting into this, please brush up on the basic concepts of Node.js, unit testing and git.
Setting up Node.js Application:
2. Create src/index.js
3. Add test file — src/app.test.js
4. Add scripts section in package.json
Setting up GitHub Actions:
Let’s do a deep dive into the workflow configuration
Now we have the initial setup ready.
Steps to test the workflow:
1.Make some changes anywhere in the app.js file (Ex: console.log())
2. Commit and push the changes to your repository. Since we configured the push event in our workflow, it will be triggered automatically
3. Check the Actions tab from the GitHub page to get the status of workflows
4. Optional — You can try to create a new branch from the main branch, make some changes and then merge it back to the main branch to test the pull_request event
Summary:
We have discussed the basics of GitHub actions. But this is not the end, based on the requirement of the project, you can also configure the following items,
To learn more, please check out the official documentation — GitHub Actions Documentation — GitHub Docs
Repository reference — GanapathiSubramanian/githubActions
Thank you for your time. Happy learning :)
Join other developers and claim your FAUN account now!
Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.