Some checks failed
CMS CI / Governance Checks (push) Failing after 56s
CMS CI / Lint Typecheck Unit E2E (push) Has been skipped
CMS CI/CD (Theoretical) / Lint Typecheck Tests (push) Failing after 37s
CMS CI/CD (Theoretical) / Build Staging Images (push) Has been skipped
CMS CI/CD (Theoretical) / Build Production Images (push) Has been skipped
CMS CI/CD (Theoretical) / Deploy Staging (Placeholder) (push) Has been skipped
CMS CI/CD (Theoretical) / Deploy Production (Placeholder) (push) Has been skipped
114 lines
2.9 KiB
YAML
114 lines
2.9 KiB
YAML
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"
|