-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (31 loc) · 968 Bytes
/
npm-publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Publish to NPM
on:
push:
branches:
- master
jobs:
build_publish:
runs-on: ubuntu-latest
steps:
- name: detect package.version changes
uses: MontyD/package-json-updated-action@master
id: version-updated
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
if: steps.version-updated.outputs.has-updated
- name: Setup Node
uses: actions/setup-node@v4
if: steps.version-updated.outputs.has-updated
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies and build 🔧
if: steps.version-updated.outputs.has-updated
run: npm ci && npm run build
- name: Publish package on NPM 📦
if: steps.version-updated.outputs.has-updated
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}