feat: update github actions for mobile #2
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 | |
env: | |
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CF_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
TURSO_CONNECTION_URL: ${{ secrets.TURSO_CONNECTION_URL }} | |
TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }} | |
TRUSTED_ORIGINS: ${{ secrets.TRUSTED_ORIGINS }} | |
BASE_URL: ${{ secrets.BASE_URL }} | |
on: | |
push: | |
branches: | |
- production | |
paths: | |
- apps/api/** | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install | |
working-directory: ./apps/api | |
- name: 🔦 Run linter | |
run: bun run lint | |
working-directory: ./apps/api | |
- name: 🪐 Check TypeScript | |
run: bun run check:types | |
working-directory: ./apps/api | |
- name: Deploy to Cloudflare Workers | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
packageManager: bun | |
apiToken: ${{ env.CF_API_TOKEN }} | |
accountId: ${{ env.CF_ACCOUNT_ID }} | |
workingDirectory: "apps/api" | |
wranglerVersion: "3.99.0" | |
command: deploy --minify src/index.ts --env production | |
--var TURSO_CONNECTION_URL:${{ env.TURSO_CONNECTION_URL }} | |
--var TURSO_AUTH_TOKEN:${{ env.TURSO_AUTH_TOKEN }} | |
--var TRUSTED_ORIGINS:${{ env.TRUSTED_ORIGINS }} | |
--var BASE_URL:${{ env.BASE_URL }} | |