Skip to content

Merge pull request #27 from alphagov/dependabot/npm_and_yarn/npm_and_… #26

Merge pull request #27 from alphagov/dependabot/npm_and_yarn/npm_and_…

Merge pull request #27 from alphagov/dependabot/npm_and_yarn/npm_and_… #26

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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
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 }}