chore: update bot endpoint #24
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 production | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/deploy.yml" | |
| - "wrangler.toml" | |
| - "src/**/**.rs" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - "rust-toolchain.toml" | |
| jobs: | |
| check: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: checks | |
| run: | | |
| cargo fmt --all --check | |
| deploy: | |
| needs: [check] | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install worker-build | |
| run: | | |
| cargo install worker-build | |
| - name: Deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| env: | |
| ENDPOINT: ${{ secrets.ENDPOINT }} | |
| BOT_APIKEY: ${{ secrets.BOT_APIKEY }} | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| secrets: | | |
| CANGREBOT_API_ENDPOINT | |
| BOT_APIKEY |