chore: Add tracing #44
This file contains 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" | |
- "frontend/**" | |
- "crates/backend/**" | |
- "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 | |
- name: checks | |
run: | | |
cargo fmt --all --check | |
deploy: | |
needs: [check] | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
path: | |
- crates/backend | |
- frontend | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- uses: pnpm/action-setup@v4 | |
if: ${{ matrix.path == 'frontend' }} | |
with: | |
version: 9 | |
- name: Install worker-build | |
run: | | |
cargo install worker-build | |
- name: Deploy | |
uses: cloudflare/wrangler-action@v3 | |
env: | |
GH_CLIENT_ID: ${{ secrets.GH_APP_CLIENT_ID }} | |
GH_CLIENT_SECRET: ${{ secrets.GH_APP_CLIENT_SECRET }} | |
ADMINS: ${{ secrets.ADMINS }} | |
API_HOST: ${{ secrets.API_HOST }} | |
HOST: ${{ secrets.API_HOST }} | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
workingDirectory: "${{ matrix.path }}" | |
wranglerVersion: "3.67.0" | |
secrets: | | |
GH_CLIENT_ID | |
GH_CLIENT_SECRET | |
ADMINS | |
API_HOST | |
HOST |