-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.03 KB
/
.publish-npm.yml
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
39
40
41
name: .publish-npm
on:
workflow_call:
secrets:
npm-auth-token:
required: true
description: required credentials to authenticate with the aws account under which to publish
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: set node-version
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org/'
node-version-file: '.nvmrc'
cache: 'npm'
- name: node-modules cache get
uses: actions/cache/restore@v3
id: cache
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: node-modules cache miss install
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts --prefer-offline --no-audit
- name: build
run: npm run build
- name: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token }}