Skip to content

Publish Storybook GitHub Page #5

Publish Storybook GitHub Page

Publish Storybook GitHub Page #5

name: Publish Storybook GitHub Page
on: workflow_dispatch
jobs:
build:
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: yarn install
run: |
yarn install
- name: Build Storybook
run: |
yarn release-storybook
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.out/'
storybook-to-pages:
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write
id-token: write
# Deploy to the github-pages environment
environment:
name: gh-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: 'gh-pages'