Skip to content

Fix: empty Storybook args tables for slot parts [WIP] #756

Fix: empty Storybook args tables for slot parts [WIP]

Fix: empty Storybook args tables for slot parts [WIP] #756

Workflow file for this run

name: Storybook
on:
push:
branches: [main]
# Deploy a preview for every PR, not only those targeting main, so stacked PRs
# (e.g. one based on another feature branch) still get a preview URL + comment.
pull_request:
workflow_dispatch: # manual redeploy (e.g. to restore production)
# One deploy per ref; a newer push supersedes an in-flight one.
concurrency:
group: storybook-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Build & deploy Storybook
runs-on: ubuntu-latest
# Run for push + manual dispatch; for PRs only same-repo ones (forks can't
# read the Cloudflare secrets, so skip them instead of failing).
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
permissions:
contents: read
pull-requests: write # post the preview URL back on the PR
steps:
- uses: actions/checkout@v6
- uses: voidzero-dev/setup-vp@v1
with:
node-version-file: .node-version
cache: true
- run: vp run -r build-storybook
# PR → a versioned upload aliased to the PR number, which yields a stable
# preview URL (pr-<n>-propel-storybook.<subdomain>.workers.dev) without
# touching production. push + manual dispatch → production deploy.
# https://developers.cloudflare.com/workers/configuration/previews/
- name: Deploy to Cloudflare Workers
id: deploy
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: packages/propel
# Run our lockfile wrangler (a @plane/propel devDep), not the action's
# own. `packageManager: npm` makes the action invoke `npx wrangler …`,
# and under setup-vp `npx` is a symlink to `vp` — so it runs the
# installed wrangler. Omitting `wranglerVersion` skips the action's
# install (and the npx fetch that flaked on @cloudflare/workerd-*).
packageManager: npm
command: >-
${{ github.event_name == 'pull_request'
&& format('versions upload --preview-alias pr-{0}', github.event.pull_request.number)
|| 'deploy' }}
# The action's deployment-url is the per-version URL
# (https://<version>-propel-storybook.<subdomain>.workers.dev). Swap the
# version prefix for the stable `pr-<n>` alias (created by --preview-alias),
# which stays constant across pushes.
- name: Comment preview URL on the PR
if: github.event_name == 'pull_request' && steps.deploy.outputs.deployment-url != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
URL: ${{ steps.deploy.outputs.deployment-url }}
run: |
alias=$(printf '%s' "$URL" | sed -E "s#^https://[^-]+-#https://pr-${PR}-#")
gh pr comment "$PR" --edit-last --create-if-none \
--body "📚 **Storybook preview:** $alias"