Merge pull request #1431 from alphagov/dependabot/npm_and_yarn/multi-… #205
This file contains hidden or 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 to registry | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| id-token: write | |
| 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Node | |
| uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| cache-dependency-path: 'package-lock.json' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Upgrade npm # Required so we can use OIDC | |
| run: npm install -g npm@11.6.0 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run compile | |
| - name: Publish package | |
| run: npm publish |