Skip to content

Create publish.yml

Create publish.yml #1

Workflow file for this run

name: Publish Package
on:
push:
branches:
- main
workflow_dispatch:
jobs:
test-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org/"
- name: Install Dependencies
run: npm ci
- name: Build Package
run: npm run build
- name: Publish to NPM
if: github.ref == 'refs/heads/main'
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}