Skip to content

Workflow file for this run

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 }}