Merge pull request #29 from ut42tech/develop #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: Deploy API | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'apps/api/**' | |
| - 'packages/db/**' | |
| - 'packages/shared/**' | |
| - 'pnpm-lock.yaml' | |
| - 'package.json' | |
| - 'tsconfig.base.json' | |
| - '.github/workflows/deploy-api.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: deploy-api | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check API | |
| run: pnpm --filter @tecnova/api type-check | |
| - name: Apply D1 migrations (remote) | |
| run: pnpm --filter @tecnova/api db:apply:remote | |
| - name: Deploy to Cloudflare Workers | |
| run: pnpm --filter @tecnova/api run deploy |