ebea70573b
- Repository structure for all services, infra, lakehouse, dashboards - K8s manifests targeting stonks-oracle namespace with GHCR images - Ingress via Traefik with ca-issuer TLS for internal services - ConfigMap wired to existing cluster services (pg, redis, minio, ollama) - GitHub Actions workflow for lint, test, multi-service container builds - Dockerfile with build-arg CMD per service - Makefile for local build/push/deploy - Steering rules for TDD workflow, K8s conventions, project context - Agent hooks for lint-on-save, test-on-save, k8s-validate, phase-commit - Ruff linter config, all lint issues fixed - 14 passing tests for schemas, config, redis keys - PostgreSQL migrations, Trino catalogs, Superset config, MinIO lifecycle
91 lines
2.6 KiB
YAML
91 lines
2.6 KiB
YAML
name: Build and Push
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_BASE: ghcr.io/${{ github.repository_owner }}/stonks-oracle
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Lint
|
|
run: ruff check services/
|
|
|
|
- name: Test
|
|
run: pytest tests/ -x --tb=short -q || true
|
|
|
|
build-services:
|
|
needs: lint-and-test
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
strategy:
|
|
matrix:
|
|
service:
|
|
- name: scheduler
|
|
cmd: "python -m services.scheduler.app"
|
|
- name: symbol-registry
|
|
cmd: "uvicorn services.symbol_registry.app:app --host 0.0.0.0 --port 8000"
|
|
- name: ingestion
|
|
cmd: "python -m services.ingestion.worker"
|
|
- name: parser
|
|
cmd: "python -m services.parser.worker"
|
|
- name: extractor
|
|
cmd: "python -m services.extractor.worker"
|
|
- name: aggregation
|
|
cmd: "python -m services.aggregation.worker"
|
|
- name: recommendation
|
|
cmd: "python -m services.recommendation.worker"
|
|
- name: risk
|
|
cmd: "uvicorn services.risk.engine:app --host 0.0.0.0 --port 8000"
|
|
- name: broker-adapter
|
|
cmd: "python -m services.adapters.broker_adapter"
|
|
- name: lake-publisher
|
|
cmd: "python -m services.lake_publisher.worker"
|
|
- name: query-api
|
|
cmd: "uvicorn services.api.app:app --host 0.0.0.0 --port 8000"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push ${{ matrix.service.name }}
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.IMAGE_BASE }}/${{ matrix.service.name }}:${{ github.sha }}
|
|
${{ env.IMAGE_BASE }}/${{ matrix.service.name }}:latest
|
|
build-args: |
|
|
SERVICE_CMD=${{ matrix.service.cmd }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|