'How to build an NPM Package on:push in github and commit the build to a specific branch?

I am using a github private repository specifically a branch as a shared npm package. I want to create a CI/CD pipeline that builds the package and commits to the branch.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source