The new Github actions are pretty good, and by adding a secret NPM_TOKEN, you could activate an action whenever a new tagged master is built.
The action could:
- Build the repository to
./build
- Tag the build with the version from commit
- Push the new version to npmjs via secret