Deploy API #38
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-ignore: | |
| - 'client/**' | |
| - '.github/workflows/client.yml' | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| type: environment | |
| description: Choose an environment to deploy to | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| DEPLOYMENT_ENV: ${{ inputs.environment == 'Production' && 'prod' || 'dev'}} | |
| environment: ${{ inputs.environment == 'Production' && 'Production' || 'Development' }} | |
| name: Deploy | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Create migrations | |
| run: pnpm db:generate | |
| - uses: cloudflare/wrangler-action@v3 | |
| with: | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| command: deploy --minify --env ${{ env.DEPLOYMENT_ENV }} --var CLERK_SECRET_KEY:${{ secrets.CLERK_SECRET_KEY }} AUTH_SECRET_KEY:${{ secrets.AUTH_SECRET_KEY }} INIT_SEAT:${{ secrets.INIT_SEAT }} | |
| environment: ${{ env.DEPLOYMENT_ENV }} |