Skip to content

Deploy Storybook to GitHub Pages #73

Deploy Storybook to GitHub Pages

Deploy Storybook to GitHub Pages #73

name: Deploy Storybook to GitHub Pages
on:
workflow_dispatch:
workflow_run:
workflows:
- 'Test and Lint'
branches:
- main
types:
- completed
concurrency:
group: storybook-deploy
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: Setup Node
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
with:
node-version-file: '.tool-versions'
cache: 'yarn'
- name: Install dependencies
run: yarn install-ci
- name: Build storybook
run: yarn build-storybook
- name: Upload storybook
uses: actions/upload-pages-artifact@84bb4cd4b733d5c320c9c9cfbc354937524f4d64 # v1
with:
path: ./storybook-static
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.pages_deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy storybook
id: pages_deployment
uses: actions/deploy-pages@12ab2b16cf43a7a061fe99da74b6f8f11fb77f5b # v2