What to ship, well… A package of course!

So you’ll probably have something way more interesting to build for your workflow, but for this post we’ll create a new empty package named “@niclas-test/test” with the below package.json that describes the package.

Step 1. Define the package

We’ll setup an package.json with some basic information, package name, git location etc.

Let’s add something interesting to this package:

index.js

Nice, our package is done, let’s head over to Github and define our Github Actions workflow, well, we’ll stay in our local environment as we define the workflow using code.

Step 2. Define the build process for Github Actions Workflow

Github actions reside in the dedicated directory github/workflows

A couple of things to point out in the snippet above

The trigger, i.e. what will initiate the build and deployment of the package, the “on: push: branches: master” tells Github to build on all commits to master, but maybe you are building feature branches as well, just change accordingly to your needs. The endpoint of the registry, i.e. where do we send out artifacts The credentials needed to authenticate towards the registry,

Step 3. Set up a private registry

For this post, we’ll publish our package to a Bytesafe private registry. It’s free to sign-up and use, head over and set up your own private registry now, it’ll take less than a minute. I’ll wait here.

(There are of course other options out there and the workflow should be similar)