feat(storybook): complete Storybook setup with Cloudflare deployment #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Storybook to Cloudflare Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build packages | |
| run: | | |
| pnpm -F @uix/core build | |
| pnpm -F @uix/lucid-tokens build | |
| pnpm -F @uix/agent build | |
| - name: Build Storybook | |
| run: pnpm -F @uix/storybook build | |
| - name: Deploy to Cloudflare Pages | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: | | |
| # Create project if not exists (ignore error if already exists) | |
| npx wrangler pages project create uix --production-branch=main 2>/dev/null || true | |
| # Deploy | |
| npx wrangler pages deploy apps/storybook/storybook-static --project-name=uix |