Deploy Cloudflare Pages #5
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 Cloudflare Pages | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: cloudflare-pages | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| name: Validate, build and deploy | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Verify deployment workflow policy | |
| run: python3 scripts/verify_cloudflare_workflow.py .github/workflows/deploy-cloudflare-pages.yml | |
| - name: Set up mise toolchain | |
| uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 | |
| with: | |
| cache: true | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run quality checks | |
| run: mise run check | |
| - name: Verify static deployment artifact | |
| run: python3 scripts/verify_static_build.py dist | |
| - name: Deploy to Cloudflare Pages | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| run: pnpm exec wrangler pages deploy dist --project-name kafu | |
| - name: Verify production site and avatar proxy | |
| run: >- | |
| python3 scripts/verify_production_avatar.py | |
| https://kafu-8bd.pages.dev | |
| --attempts 8 | |
| --delay 5 |