Skip to content

Merge pull request #31 from alphagov/PP-12687-dependency-review-workflow #30

Merge pull request #31 from alphagov/PP-12687-dependency-review-workflow

Merge pull request #31 from alphagov/PP-12687-dependency-review-workflow #30

name: Publish to registry
on:
push:
branches:
- main
permissions:
contents: read
jobs:
unit-tests:
uses: ./.github/workflows/_run-tests.yml
publish:
needs: unit-tests
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, '[automated release]')"
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}