refactor: simplify CI/CD to single build pipeline
Some checks failed
Build / Code Quality Checks (push) Successful in 7m43s
Build / Build & Push Docker Images (chat) (push) Failing after 3m6s
Build / Build & Push Docker Images (api) (push) Failing after 3m38s
Build / Build & Push Docker Images (worker) (push) Failing after 3m36s
Build / Build & Push Docker Images (frontend) (push) Successful in 4m12s

Remove all unnecessary pipelines and consolidate into a single
simple build pipeline that runs on every push to main.

## Pipeline Flow

1. **Lint Job**: Code quality checks
   - Black (formatting)
   - Ruff (linting)
   - MyPy (type checking)

2. **Build & Push Job**: Docker images (needs: lint)
   - Matrix build: [api, chat, worker, frontend]
   - Push to container registry
   - BuildKit caching

## Removed Pipelines

-  test.yml (no tests yet)
-  security.yml (not needed for now)
-  deploy-staging.yml (manual deployment)
-  deploy-production.yml (manual deployment)
-  docs-generation.yml (not needed)
-  lint.yml (merged into build)
-  ci.yml.old (old backup)
-  README.md (unnecessary complexity)

## Benefits

-  Simple and focused
-  Fast feedback on main pushes
-  Quality checks before build
-  Easy to understand and maintain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-21 13:42:41 +02:00
parent d6d44270ee
commit 2db606ea00
9 changed files with 42 additions and 825 deletions

View File

@@ -1,22 +1,58 @@
# Build and Push Docker Images
# Runs on every push to main branch
# 1. Lint: Black, Ruff, MyPy
# 2. Build & Push: Docker images to registry
name: Build
on:
push:
branches: [ main ]
tags:
- 'v*'
env:
POETRY_VERSION: 1.8.0
PYTHON_VERSION: "3.12"
REGISTRY: ${{ vars.PACKAGES_REGISTRY }}
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-push:
name: Build and Push Docker Images
lint:
name: Code Quality Checks
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry install --no-root
- name: Run Black
run: poetry run black --check src/ tests/
- name: Run Ruff
run: poetry run ruff check src/ tests/
- name: Run MyPy
run: poetry run mypy src/
build-and-push:
name: Build & Push Docker Images
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
@@ -43,11 +79,8 @@ jobs:
images: ${{ vars.PACKAGES_REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.component }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v5