Continuous integration with Github Actions
Now that our component library is building we have to find a secure way to publish our package. It's possible to lint, test, and publish our package locally, but this can be difficult to enforce with larger teams. In this module we will be automating our publish process in a CI/CD environment.
Since we are storing our repository within GitHub we will be using GitHub Actions as the CI/CD environment and GitHub Packages as our private NPM registry. Both services have a generous free tier for open-source software as well as monthly credits for private packages. Everything we do in this module will stay within the limits of the free tier.
GitHub Actions configuration#
GitHub Actions runs workflows based on repository events. For our publish workflow we will only want to run if a new NPM version has been tagged in git (
To enable this workflow create a new file at