Add workers.dev Route #6
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: Add workers.dev Route | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| add-route: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add workers.dev Route for natalie-proxy | |
| env: | |
| CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| run: | | |
| set -x | |
| echo "=== Enable workers.dev route ===" | |
| # Add a route for the workers.dev subdomain | |
| curl -s -X POST \ | |
| "https://api.cloudflare.com/client/v4/accounts/6a46b418508c26278ae2d3373f41da81/workers/scripts/natalie-proxy/routes" \ | |
| -H "Authorization: Bearer $CF_API_TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "pattern": "natalie-proxy.natalie.workers.dev/*", | |
| "script": "natalie-proxy" | |
| }' | jq . | |
| echo "=== Done ===" |