x402-url-to-markdown / tree / .github/workflows/deploy.yml ยท raw (this view has old GitHub links rewritten for the mirror; raw is byte-exact)
name: deploy-worker
on:
  workflow_dispatch:
  push:
    branches: [main]
    paths: ['src/**', 'wrangler.toml', 'package.json']
jobs:
  deploy:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22 }
      - run: npm install --no-audit --no-fund
      - run: npm test
      - run: npx wrangler deploy
        env:
          CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
      - name: smoke test
        run: |
          U=https://webread.agentgate.workers.dev
          sleep 8
          curl -sS -m 30 --retry 3 -H "x-webread-smoke: 1" "$U/health"
          code=$(curl -sS -m 30 -H "x-webread-smoke: 1" -o /dev/null -w "%{http_code}" "$U/v1/read?url=https://example.com/"); echo "paid route $code"; test "$code" = 402
          code=$(curl -sS -m 30 -H "x-webread-smoke: 1" -o /dev/null -w "%{http_code}" "$U/v1/read/preview?url=https://example.com/"); echo "preview $code"; test "$code" = 200

agentgate-source: code mirror on Cloudflare Pages. All repos