Skip to content

Commit

Permalink
feat: add workflow to deploy storybook to github page
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanie56 committed Apr 26, 2024
1 parent dacb138 commit c3c33e4
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy Storybook to Github Page for PR

on:
pull_request:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}


jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout the codebase
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Build Storybook
run: npm run build-storybook

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./storybook-static

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit c3c33e4

Please sign in to comment.