Skip to content

Deploy Storybook to GitHub Pages #74

Deploy Storybook to GitHub Pages

Deploy Storybook to GitHub Pages #74

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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup Node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # 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@de14547edc9944350dc0481aa5b7afb08e75f254 # v2