aff52e5672
- shared/schemas/: move Zod schemas out of routes so client + server share them - shared/types.ts: inferred types and enums for cross-package use - server tsconfig rootDir raised to ".." so shared/ compiles in-tree - server/src/services/: ticket, comment, cti, user, auth, notification (stub), search (stub) - Routes thinned to validate-delegate-return; business logic now testable in isolation - server/src/lib/httpError.ts: typed HttpError replaces ad-hoc throw shapes - server/src/lib/logger.ts: pino structured logging replaces console.log - autoClose job delegates to ticketService.closeStale() - express-rate-limit on /api/auth/login (10 / 15min / IP) - vitest + vitest-mock-extended; 20 service-level tests cover auth, ticket, comment, user flows - CI: lint + test jobs before docker builds Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
87 lines
2.1 KiB
YAML
87 lines
2.1 KiB
YAML
name: Build & Push
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
REGISTRY: ${{ vars.REGISTRY }}
|
|
OWNER: ${{ github.repository_owner }}
|
|
|
|
jobs:
|
|
typecheck-client:
|
|
name: TypeScript Check (client)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
working-directory: ./client
|
|
|
|
- name: Type check
|
|
run: npx tsc --noEmit
|
|
working-directory: ./client
|
|
|
|
build-server:
|
|
name: Build Server
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ env.OWNER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push server
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./server/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.OWNER }}/ticketing-server:latest
|
|
${{ env.REGISTRY }}/${{ env.OWNER }}/ticketing-server:${{ github.sha }}
|
|
|
|
build-client:
|
|
name: Build Client
|
|
needs: typecheck-client
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ env.OWNER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push client
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./client/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.OWNER }}/ticketing-client:latest
|
|
${{ env.REGISTRY }}/${{ env.OWNER }}/ticketing-client:${{ github.sha }}
|