🌟 Production Deployment - API #33
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: 🌟 Production Deployment - API | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- apps/api/** | |
jobs: | |
deploy-production: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: 📦 Install dependencies | |
run: bun install | |
- name: 🔦 Run type checking | |
run: bun turbo typecheck --filter=@languine/api | |
- name: 🔬 Run linting | |
run: bun turbo lint --filter=@languine/api | |
- name: 🧪 Run unit tests | |
run: bun turbo test --filter=@languine/api | |
- name: 🗃️ Apply database migrations | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
packageManager: bun | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
workingDirectory: "apps/api" | |
wranglerVersion: "latest" | |
command: d1 migrations apply languine-production --env production --remote | |
- name: 🚀 Deploy Project Artifacts to Cloudflare | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
packageManager: bun | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
workingDirectory: "apps/api" | |
wranglerVersion: "latest" | |
command: deploy --minify src/index.ts --env production |