Todo
This commit is contained in:
103
.gitea/workflows/ci-cd-theoretical.yml
Normal file
103
.gitea/workflows/ci-cd-theoretical.yml
Normal file
@@ -0,0 +1,103 @@
|
||||
name: CMS CI/CD (Theoretical)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- staging
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BUN_VERSION: "1.3.5"
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
name: Lint Typecheck Tests
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
|
||||
build_staging_images:
|
||||
name: Build Staging Images
|
||||
runs-on: ubuntu-latest
|
||||
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: ubuntu-latest
|
||||
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: 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 }}"
|
||||
|
||||
deploy_staging:
|
||||
name: Deploy Staging (Placeholder)
|
||||
runs-on: ubuntu-latest
|
||||
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: ubuntu-latest
|
||||
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"
|
||||
Reference in New Issue
Block a user