name: Deploy Auth Inbox to Cloudflare Workers on: push: branches: - main workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest permissions: contents: read name: Deploy Auth Inbox Worker steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' cache: 'pnpm' - name: Install Dependencies run: pnpm install --frozen-lockfile - name: Build Web App run: pnpm run build:web - name: Apply D1 Migrations run: | echo '${{ secrets.TOML }}' > wrangler.toml pnpm run db:migrate:remote env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - name: Deploy Backend for ${{ github.ref_name }} run: | pnpm exec wrangler deploy env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}