diff --git a/.gitea/workflows/ci-cd-theoretical.yml b/.gitea/workflows/ci-cd-theoretical.yml deleted file mode 100644 index 2278c1a..0000000 --- a/.gitea/workflows/ci-cd-theoretical.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: CMS CI/CD (Theoretical) - -on: - pull_request: - push: - branches: - - dev - - main - - staging - tags: - - "v*" - workflow_dispatch: - -env: - BUN_VERSION: "1.3.5" - -jobs: - quality: - name: Lint Typecheck Tests - runs-on: node22-bun - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: ${{ env.BUN_VERSION }} - - - name: Install dependencies - run: bun install --frozen-lockfile - - - name: Generate Prisma client - run: bun run db:generate - - - name: Lint - run: bun run lint - - - name: Typecheck - run: bun run typecheck - - - name: Unit and component tests - run: bun run test - - - name: E2E suite discovery check - run: bun run test:e2e --list - - - name: Conventional commit check (latest commit) - run: bun run commitlint - - build_staging_images: - name: Build Staging Images - runs-on: node22-bun - needs: quality - if: github.ref == 'refs/heads/staging' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build web image (staging) - run: docker build -f apps/web/Dockerfile -t cms-web:staging . - - - name: Build admin image (staging) - run: docker build -f apps/admin/Dockerfile -t cms-admin:staging . - - build_production_images: - name: Build Production Images - runs-on: node22-bun - needs: quality - if: startsWith(github.ref, 'refs/tags/v') - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build web image (production) - run: docker build -f apps/web/Dockerfile -t cms-web:${{ github.ref_name }} . - - - name: Build admin image (production) - run: docker build -f apps/admin/Dockerfile -t cms-admin:${{ github.ref_name }} . - - - name: Generate changelog - run: | - bun install --frozen-lockfile - bun run changelog:release - - - name: Push images (placeholder) - run: | - echo "TODO: docker login to registry" - echo "TODO: docker push cms-web:${{ github.ref_name }}" - echo "TODO: docker push cms-admin:${{ github.ref_name }}" - echo "TODO: publish CHANGELOG.md content as release notes" - - deploy_staging: - name: Deploy Staging (Placeholder) - runs-on: node22-bun - needs: build_staging_images - if: github.ref == 'refs/heads/staging' - steps: - - name: Deploy placeholder - run: | - echo "TODO: Pull and restart staging compose on target host" - echo "docker compose -f docker-compose.staging.yml up -d" - - deploy_production: - name: Deploy Production (Placeholder) - runs-on: node22-bun - needs: build_production_images - if: startsWith(github.ref, 'refs/tags/v') - steps: - - name: Deploy placeholder - run: | - echo "TODO: Pull and restart production compose on target host" - echo "docker compose -f docker-compose.production.yml up -d" diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 18b9f93..0e7683e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -90,6 +90,9 @@ jobs: - name: Lint and format checks run: bun run check + - name: Generate Prisma client + run: bun run db:generate + - name: Typecheck run: bun run typecheck diff --git a/README.md b/README.md index 2828d3d..ebb1233 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,11 @@ bunx playwright install ## Delivery Scaffolding -The repo includes a theoretical CI/CD and deployment baseline: +The repo includes a CI/CD and deployment baseline: -- Gitea workflow: `.gitea/workflows/ci-cd-theoretical.yml` -- Real quality gate workflow: `.gitea/workflows/ci.yml` +- Quality gate workflow: `.gitea/workflows/ci.yml` +- Deployment workflow: `.gitea/workflows/deploy.yml` +- Release workflow: `.gitea/workflows/release.yml` - App images: - `apps/web/Dockerfile` - `apps/admin/Dockerfile` diff --git a/TODO.md b/TODO.md index 265dbb4..65be19c 100644 --- a/TODO.md +++ b/TODO.md @@ -81,7 +81,7 @@ This file is the single source of truth for roadmap and delivery progress. ### Delivery Pipeline And Runtime -- [x] [P2] Theoretical Gitea Actions workflow scaffold (`.gitea/workflows/ci-cd-theoretical.yml`) +- [x] [P2] Gitea workflow baseline (`.gitea/workflows/ci.yml`, `.gitea/workflows/deploy.yml`, `.gitea/workflows/release.yml`) - [x] [P2] Bun-based Dockerfiles for public and admin apps - [x] [P2] Staging and production docker-compose templates - [x] [P1] Registry credentials and image push strategy diff --git a/commitlint.config.cjs b/commitlint.config.cjs index 811df3c..516f787 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -6,7 +6,7 @@ module.exports = { "always", ["feat", "fix", "refactor", "perf", "test", "docs", "build", "ci", "chore", "revert"], ], - "scope-empty": [2, "never"], + "scope-empty": [0], "subject-empty": [2, "never"], }, } diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index 2154806..a135e21 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -1,6 +1,5 @@ generator client { - provider = "prisma-client" - output = "./generated/client" + provider = "prisma-client-js" } datasource db { diff --git a/packages/db/src/client.ts b/packages/db/src/client.ts index 4423065..1efb458 100644 --- a/packages/db/src/client.ts +++ b/packages/db/src/client.ts @@ -1,6 +1,6 @@ import { PrismaPg } from "@prisma/adapter-pg" +import { PrismaClient } from "@prisma/client" import { Pool } from "pg" -import { PrismaClient } from "../prisma/generated/client/client" const connectionString = process.env.DATABASE_URL diff --git a/packages/db/src/posts.ts b/packages/db/src/posts.ts index 46051b7..5faad3d 100644 --- a/packages/db/src/posts.ts +++ b/packages/db/src/posts.ts @@ -4,8 +4,8 @@ import { type UpdatePostInput, updatePostInputSchema, } from "@cms/content" +import type { Post } from "@prisma/client" import { type CrudAuditHook, type CrudMutationContext, createCrudService } from "@cms/crud" -import type { Post } from "../prisma/generated/client/client" import { db } from "./client"