perf: index pwa cache batch #70
Workflow file for this run
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 to Cloudflare Pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/deploy.yml' | |
| - 'components.json' | |
| - 'drizzle.config.ts' | |
| - 'index.html' | |
| - 'package.json' | |
| - 'playwright.config.ts' | |
| - 'pnpm-lock.yaml' | |
| - 'public/**' | |
| - 'src/**' | |
| - 'tsconfig.app.json' | |
| - 'tsconfig.json' | |
| - 'tsconfig.node.json' | |
| - 'vite.config.ts' | |
| - 'wrangler.toml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/deploy.yml' | |
| - 'components.json' | |
| - 'drizzle.config.ts' | |
| - 'index.html' | |
| - 'package.json' | |
| - 'playwright.config.ts' | |
| - 'pnpm-lock.yaml' | |
| - 'public/**' | |
| - 'src/**' | |
| - 'tsconfig.app.json' | |
| - 'tsconfig.json' | |
| - 'tsconfig.node.json' | |
| - 'vite.config.ts' | |
| - 'wrangler.toml' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.19' | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile --ignore-scripts | |
| - run: pnpm build | |
| - name: Deploy to Cloudflare Pages | |
| id: deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy dist/ --project-name=today-little-log --branch=${{ github.head_ref || github.ref_name }} | |
| - name: Smoke production | |
| if: github.event_name == 'push' | |
| run: curl --fail --silent --show-error --location --output /dev/null --retry 3 --retry-delay 5 https://today-little-log.pages.dev | |
| - name: Comment preview URL on PR | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const url = '${{ steps.deploy.outputs.deployment-url }}' || 'https://${{ github.head_ref }}.today-little-log.pages.dev'; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `🚀 **Preview deployed:** ${url}` | |
| }) |