Skip to content

Commit

Permalink
Updated the workflow to deploy Storybook
Browse files Browse the repository at this point in the history
to GitHub pages.
  • Loading branch information
jaieds committed Nov 20, 2024
1 parent d7f396c commit 266131e
Showing 1 changed file with 33 additions and 30 deletions.
63 changes: 33 additions & 30 deletions .github/workflows/storybook-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
name: 'Chromatic GitHub Deployment'

# Workflow name
name: Build and Publish Storybook to GitHub Pages

on:
push:
branches:
- master

# Event for the workflow to run on
push:
branches:
- storybook-to-ghpage # Replace with the branch you want to deploy from

permissions:
contents: read
pages: write
id-token: write

# List of jobs
jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
# ⚠️ See your package manager's documentation for the correct command to install dependencies in a CI environment.
run: npm install && npm run build && npm run build-storybook && npm run deploy-storybook -- --ci
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}

- name: Run Chromatic
uses: chromaui/action@latest
with:
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
zip: true
onlyChanged: true # 👈 Required option to enable TurboSnap
deploy:
runs-on: ubuntu-latest
# Job steps
steps:
# Manual Checkout
- uses: actions/checkout@v4

# Set up Node
- uses: actions/setup-node@v4
with:
node-version: '20.x'

#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
- uses: bitovi/[email protected]
with:
install_command: npm install # default: npm ci
build_command: npm run build-storybook # default: npm run build-storybook
path: storybook-static # default: dist/storybook
checkout: false # default: true

0 comments on commit 266131e

Please sign in to comment.