WIP: Automate publish to npm #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |