Skip to content

CD - Publish to NPM

CD - Publish to NPM #2

Workflow file for this run

name: Publish
run-name: CD - Publish to NPM
on:
pull_request:
branches: [master]
types: [closed]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Confirm PR is merged
if: github.event.pull_request.merged != true
run: exit 1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}