Skip to content

Commit

Permalink
ci: publish package to npm registry
Browse files Browse the repository at this point in the history
Signed-off-by: Raúl Fernández Fernández <[email protected]>
  • Loading branch information
rfdez committed Jul 10, 2023
1 parent 89ec97d commit 8aa547f
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish

on:
push:
tags:
- '*'

jobs:
ci:
name: Lint & Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Lint & Build Code
run: npm run prepublishOnly --if-present

publish:
name: Publish Package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm ci

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

0 comments on commit 8aa547f

Please sign in to comment.