diff --git a/.github/workflows/ci-tests-storybook.yaml b/.github/workflows/ci-tests-storybook.yaml index 4c2fb4478f..d2fa26826c 100644 --- a/.github/workflows/ci-tests-storybook.yaml +++ b/.github/workflows/ci-tests-storybook.yaml @@ -4,6 +4,8 @@ name: 'CI: Tests Storybook' on: workflow_dispatch: # Allow manual triggering pull_request: + push: + branches: [main] jobs: # Post starting comment for non-forked PRs @@ -138,6 +140,29 @@ jobs: "${{ github.head_ref }}" \ "completed" + # Deploy Storybook to production URL on main branch push + deploy-production: + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup frontend + uses: ./.github/actions/setup-frontend + + - name: Build Storybook + run: pnpm build-storybook + + - name: Deploy to Cloudflare Pages (production) + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + run: | + npx wrangler@^4.0.0 pages deploy storybook-static \ + --project-name=comfy-storybook \ + --branch=main + # Update comment with Chromatic URLs for version-bump branches update-comment-with-chromatic: needs: [chromatic-deployment, deploy-and-comment]