refactor(www): migrate from Workers to Cloudflare Pages for static de… #116
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 www | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'apps/www/**' | |
| - 'packages/elements/**' | |
| - 'packages/examples/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| deployments: write | |
| pull-requests: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Publish www to Cloudflare Pages | |
| concurrency: | |
| group: deploy-www-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup (Install Node & pnpm) | |
| uses: ./.github/actions/setup | |
| - name: Install dependencies | |
| run: pnpm i --frozen-lockfile | |
| - name: Build www | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| run: pnpm build:www | |
| - name: Publish to Cloudflare Pages via Wrangler | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: | | |
| pnpm --filter www deploy |