Deploy Cloudflare Worker #40
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 (AIDEN Proxy) | |
| 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 }} | |
| run: | | |
| echo "$OPENROUTER_API_KEY" | wrangler secret put OPENROUTER_API_KEY || true | |
| wrangler deploy | |
| - name: Confirm | |
| run: echo "Worker published (if no errors above)." |