chore: CI: publish to npm using OIDC tokens

see also https://docs.npmjs.com/trusted-publishers
This commit is contained in:
Jannis R 2025-10-22 16:12:16 +02:00
parent c2216120c9
commit 5ef2eca999
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -10,6 +10,9 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
id-token: write # for OIDC-based publishing to npm
jobs:
build-and-push-docker:
runs-on: ubuntu-latest
@ -53,7 +56,9 @@ jobs:
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
# for OIDC-based publishing to npm
- name: setup npm v11
run: npm install -g npm@11
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}