Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

chore: storybook preview (#7914)

Scott Wilsone858b8888228
diff --git a/.github/workflows/publish-storybook-chromatic.yml b/.github/workflows/publish-storybook-chromatic.yml
new file mode 100644
index 0000000000..893662d8e6
--- /dev/null
+++ b/.github/workflows/publish-storybook-chromatic.yml
@@ -0,0 +1,49 @@
+name: Publish Storybook to Chromatic
+
+on:
+ pull_request:
+ types: [opened, synchronize]
+ paths:
+ - "frontend/src/components/v3/**"
+ - "frontend/src/lib/**"
+ - "frontend/src/index.css"
+ - "frontend/.storybook/**"
+ - "frontend/package-lock.json"
+ - ".github/workflows/publish-storybook-chromatic.yml"
+
+jobs:
+ chromatic:
+ name: Publish
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ # Fork PRs can't read secrets, so the publish would always fail; skip them.
+ if: ${{ !github.event.pull_request.head.repo.fork }}
+
+ steps:
+ - name: ☁️ Checkout source
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ # Chromatic needs full git history to find the baseline build
+ fetch-depth: 0
+ - name: 🔧 Setup Node 22
+ id: setup-node
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
+ with:
+ node-version: "22"
+ - name: 📦 Cache node_modules
+ id: cache-node-modules
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
+ with:
+ path: frontend/node_modules
+ key: frontend-node-modules-${{ runner.os }}-node${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('frontend/package-lock.json') }}
+ - name: 📦 Install dependencies
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: npm ci
+ working-directory: frontend
+ - name: 🎨 Publish to Chromatic
+ uses: chromaui/action@2a0b63f30233c48591844a46d451b9cf68128186 # v18.7.2
+ with:
+ projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
+ workingDir: frontend
+ onlyChanged: true
+ exitZeroOnChanges: true