Deploy Storybook to GitHub Pages #116
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Storybook to GitHub Pages | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ['Bump Version and Publish to npm'] | |
types: | |
- completed | |
permissions: | |
contents: write | |
actions: write | |
jobs: | |
build-and-deploy: | |
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
runs-on: self-hosted | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build Storybook | |
run: npm run build:storybook | |
- name: Deploy Storybook to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./storybook-static |