-
Notifications
You must be signed in to change notification settings - Fork 36
38 lines (33 loc) · 926 Bytes
/
publish.yml
File metadata and controls
38 lines (33 loc) · 926 Bytes
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
36
37
38
name: Publish Image to NPM
on: # yamllint disable-line rule:truthy
push:
branches:
- main
# Ensure only a single instance of this workflow is running.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all history for all tags and branches
- name: Npm
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
cache: "npm"
- name: Install
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_READ }}
- name: Publish
run: ./scripts/publish-if-not-exists.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_WRITE }}