# 部署静态站(Pages)+ 门面 Worker。对标本机 cf/ops/deploy-all.sh(不含 ADMIN_TOKEN 刷新)。 # Secrets:CLOUDFLARE_API_TOKEN、CLOUDFLARE_ACCOUNT_ID name: Deploy edge on: push: branches: [main] workflow_dispatch: concurrency: group: deploy-edge cancel-in-progress: true jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: lfs: true - uses: actions/setup-node@v4 with: node-version: '22' cache: npm cache-dependency-path: client/src/package-lock.json - name: Check deploy secrets env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | if [ -z "$CLOUDFLARE_API_TOKEN" ]; then echo "::error::CLOUDFLARE_API_TOKEN secret is empty — check repo Settings → Secrets → Actions" exit 1 fi if [ -z "$CLOUDFLARE_ACCOUNT_ID" ]; then echo "::error::CLOUDFLARE_ACCOUNT_ID secret is empty — check repo Settings → Secrets → Actions" exit 1 fi - name: Build frontend run: | cd client/src npm ci INFORADAR_API_BASE=https://api.info-lens.app npm run build:cf - name: Deploy Pages env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | npx wrangler@latest pages deploy ./client/dist-cf \ --project-name=infolens \ --commit-dirty=true - name: Deploy facade Worker env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: npx wrangler@latest deploy --config cf/facade/wrangler.jsonc