Add cohere model automations (#1040) #372
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 to Cloudflare | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 | |
| with: | |
| version: 10.33.0 | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 | |
| with: | |
| node-version: 24 | |
| cache: "pnpm" | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build --filter=@braintrust/ai-proxy-wrangler | |
| - name: Configure wrangler.toml | |
| working-directory: apis/cloudflare | |
| run: | | |
| cp wrangler-template.toml wrangler.toml | |
| sed -i 's/<YOUR_KV_ID>/${{ secrets.CLOUDFLARE_KV_ID }}/g' wrangler.toml | |
| sed -i 's/<YOUR_METRICS_LICENSE_KEY>/${{ secrets.METRICS_LICENSE_KEY }}/g' wrangler.toml | |
| - name: Configure Worker secrets | |
| working-directory: apis/cloudflare | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| NATIVE_INFERENCE_SECRET_KEY: ${{ secrets.NATIVE_INFERENCE_SECRET_KEY }} | |
| run: | | |
| if [ -z "${NATIVE_INFERENCE_SECRET_KEY:-}" ]; then | |
| echo "NATIVE_INFERENCE_SECRET_KEY is not set" >&2 | |
| exit 1 | |
| fi | |
| printf %s "$NATIVE_INFERENCE_SECRET_KEY" | pnpm exec wrangler secret put NATIVE_INFERENCE_SECRET_KEY | |
| - run: pnpm run deploy | |
| working-directory: apis/cloudflare | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |