Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/deploy-api-v2-docker.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion apps/api/v2/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"ignoreDeprecations": "6.0",
"module": "commonjs",
"esModuleInterop": true,
"declaration": true,
"declaration": false,
"resolveJsonModule": true,
"removeComments": true,
"emitDecoratorMetadata": true,
Expand Down
Loading