Merge pull request #519 from AcreetionOS-Code/fix/ai-guardian-2026052… #732
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 Worker | |
| concurrency: | |
| group: deploy-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| ai-review: | |
| name: AI Review (site QA) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y python3 python3-venv python3-pip | |
| - name: Run AI review | |
| env: | |
| AI_TEST_API_KEY: ${{ secrets.AI_TEST_API_KEY }} | |
| run: | | |
| python3 tests/ai-review.py || echo "AI review skipped (non-blocking)" | |
| publish-worker: | |
| name: Publish Cloudflare Worker | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Wrangler | |
| run: npm install -g wrangler@latest | |
| - name: Deploy Worker | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: | | |
| echo "$OPENROUTER_API_KEY" | wrangler secret put OPENROUTER_API_KEY || true | |
| echo "$CLOUDFLARE_API_TOKEN" | wrangler secret put CLOUDFLARE_API_TOKEN || true | |
| echo "$CLOUDFLARE_ACCOUNT_ID" | wrangler secret put CLOUDFLARE_ACCOUNT_ID || true | |
| echo "$GH_TOKEN" | wrangler secret put GH_TOKEN || true | |
| wrangler deploy | |
| - name: Confirm | |
| run: echo "Worker published (if no errors above)." |