From bc7c08ab174f6740091272d94e243100814f65a7 Mon Sep 17 00:00:00 2001 From: Shaunak Date: Wed, 19 Feb 2025 09:07:32 +0530 Subject: [PATCH] add github action for storybook --- .github/workflows/build-storybook.yml | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build-storybook.yml diff --git a/.github/workflows/build-storybook.yml b/.github/workflows/build-storybook.yml new file mode 100644 index 000000000..b1374d377 --- /dev/null +++ b/.github/workflows/build-storybook.yml @@ -0,0 +1,48 @@ +name: Build and Deploy Storybook + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build Storybook + run: npm run build:storybook + + - name: Upload Storybook Artifact + uses: actions/upload-artifact@v3 + with: + name: storybook + path: dist/storybook/ui + + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download built Storybook + uses: actions/download-artifact@v3 + with: + name: storybook + path: dist/storybook/ui + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: dist/storybook/ui