name: Deploy to Cloudflare Workers on: push: branches: [test, main] paths-ignore: - "**/*.md" - "LICENSE" - ".gitignore" - "docs/**" - "**/*.png" - "**/*.jpg" - "**/*.jpeg" - "**/*.gif" - "**/*.svg" - "AGENTS.md" jobs: deploy: if: github.repository_owner == 'newbietan' runs-on: ubuntu-latest permissions: contents: read steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4 with: version: "11.8.0" - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "22" cache: "pnpm" - name: Install dependencies run: pnpm install --frozen-lockfile - name: Install Playwright browser run: pnpm exec playwright install --with-deps chromium webkit - name: Type check run: pnpm run typecheck - name: Unit and integration tests run: pnpm test - name: Build frontend run: pnpm run build:frontend - name: Browser E2E and accessibility tests run: pnpm run test:e2e - name: Build frontend and deploy (test) if: github.ref == 'refs/heads/test' env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: pnpm run deploy:test - name: Build frontend and deploy (production) if: github.ref == 'refs/heads/main' env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: pnpm run deploy