Merge pull request #15927 from ToolJet/adishM98-patch-2

Add GitHub Actions workflow for Storybook deployment
This commit is contained in:
Adish M 2026-04-15 11:51:03 +05:30 committed by GitHub
commit c2106ca487
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,53 @@
name: Deploy Storybook to Netlify
on:
pull_request:
types: [closed]
branches:
- lts-3.16
workflow_dispatch:
inputs:
branch:
description: "Branch to deploy"
required: true
default: "lts-3.16"
jobs:
deploy-storybook:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'lts-3.16' }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22.15.1"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Build Storybook
working-directory: frontend
run: npx storybook build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v3
with:
publish-dir: frontend/storybook-static
production-branch: lts-3.16
production-deploy: ${{ github.event_name == 'pull_request' || inputs.branch == 'lts-3.16' }}
deploy-message: |
Storybook deploy from ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref_name }} @ ${{ github.sha }}
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_STORYBOOK_SITE_ID }}