-
Notifications
You must be signed in to change notification settings - Fork 160
39 lines (38 loc) · 1.33 KB
/
publish.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
name: Publish and Deploy Documentation
# When a new Github Release is created via our npm script, publish to NPM and then deploy our storybook documentation to github pages
on:
release:
types: [published]
jobs:
publish-and-deploy-documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout Package
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.tag_name }}
- name: Setup Node environment
uses: actions/setup-node@v1
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: NPM Install
run: npm install
- name: NPM run build
run: npm run build
- name: Get npm tag name if needed
id: npm_tag
run: |
pre_release_name=$(.github/script/get-pre-release-name.js)
echo "Pre release name:" $pre_release_name
echo ::set-output name=npm_tag::$pre_release_name
- name: Publish to NPM latest
if: steps.npm_tag.outputs.npm_tag == ''
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish to NPM with tag
if: steps.npm_tag.outputs.npm_tag != ''
run: npm publish --tag ${{ steps.npm_tag.outputs.npm_tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}