diff --git a/.github/workflows/deploy-api-v2-docker.yml b/.github/workflows/deploy-api-v2-docker.yml new file mode 100644 index 00000000000..effbc61280f --- /dev/null +++ b/.github/workflows/deploy-api-v2-docker.yml @@ -0,0 +1,53 @@ +name: Build and Push Crove Cal API v2 Image + +on: + push: + branches: + - dev + - main + paths: + - "apps/api/v2/**" + - "packages/**" + - ".github/workflows/deploy-api-v2-docker.yml" + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push API v2 image + uses: docker/build-push-action@v6 + with: + context: . + file: ./apps/api/v2/Dockerfile + push: true + tags: | + ghcr.io/dos/crove-cal-api:latest + ghcr.io/dos/crove-cal-api:${{ github.sha }} + cache-from: type=gha,scope=api-v2 + # Why: mode=min so the build stage (which carries DATABASE_URL in its ENV) + # is never exported into the shared Actions cache. + cache-to: type=gha,mode=min,scope=api-v2 + build-args: | + # prisma generate only parses the schema, it never connects, so these are + # format-valid placeholders. Real values come from the runtime environment. + # Passing production credentials here would bake them into image layers. + DATABASE_URL=postgresql://build:build@localhost:5432/build + DATABASE_DIRECT_URL=postgresql://build:build@localhost:5432/build diff --git a/apps/api/v2/tsconfig.json b/apps/api/v2/tsconfig.json index 59cf716bec9..9d42a373fdc 100644 --- a/apps/api/v2/tsconfig.json +++ b/apps/api/v2/tsconfig.json @@ -3,7 +3,7 @@ "ignoreDeprecations": "6.0", "module": "commonjs", "esModuleInterop": true, - "declaration": true, + "declaration": false, "resolveJsonModule": true, "removeComments": true, "emitDecoratorMetadata": true,