Skip to content

Publish and Deploy Documentation #96

Publish and Deploy Documentation

Publish and Deploy Documentation #96

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]
permissions:
id-token: write # Required for OIDC
contents: read
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@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
- 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
- name: Publish to NPM with tag
if: steps.npm_tag.outputs.npm_tag != ''
run: npm publish --tag ${{ steps.npm_tag.outputs.npm_tag }}