Skip to content

WIP: Automate publish to npm #3

WIP: Automate publish to npm

WIP: Automate publish to npm #3

Workflow file for this run

name: Publish release to npm
on:
workflow_dispatch:
pull_request:
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
with:
node-version-file: .nvmrc
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Generate tag
id: generate_tag
run: |
NPM_TAG=$(npm run generate-npm-tag --silent)
echo "NPM_TAG=${NPM_TAG#*=}" >> $GITHUB_OUTPUT
- name: Build npm package
run: npm run build:package
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --workspace govuk-frontend --dry-run --tag internal