Skip to content

Commit

Permalink
feat: add GitHub Actions workflow to deploy Storybook to GitHub Pages
Browse files Browse the repository at this point in the history
This workflow automates the process of building and deploying the Storybook to GitHub Pages when changes are pushed to the main branch. It sets up the necessary permissions, installs dependencies, builds UI components and Storybook, and then uses a GitHub action to publish the static Storybook files to GitHub Pages. This enables easy access to the latest version of the project's component library documentation.
  • Loading branch information
DGiannaris committed Dec 5, 2024
1 parent 35f1f77 commit 4d24e56
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy_storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- "main"

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

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.build-publish.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install Dependencies
run: npm ci

- name: Build UI components
run: |
cd packages/ui
npm ci
npm run build

- name: Build Storybook
run: |
cd examples/storybook
npm ci
npm run build-storybook
- id: build-publish
uses: bitovi/[email protected]
with:
path: examples/storybook/storybook-static

0 comments on commit 4d24e56

Please sign in to comment.