Skip to content

Commit

Permalink
Add node publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-dietrich committed Aug 23, 2024
1 parent 69a69a8 commit 6fc23cf
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
tags:
- '*'
workflow_dispatch:

name: Publish on NPM

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install Node.js dependencies
run: '[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true'

- name: Building Project
run: npm run build

- name: Configure npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NODE_AUTH_TOKEN}
npm config list
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}

0 comments on commit 6fc23cf

Please sign in to comment.