workspace-v1/control-plane/ci/github-actions/workflows/ci-template.yml
rckrdmrd 66161b1566 feat: Workspace-v1 complete migration with NEXUS v3.4
Sistema NEXUS v3.4 migrado con:

Estructura principal:
- core/orchestration: Sistema SIMCO + CAPVED (27 directivas, 28 perfiles)
- core/catalog: Catalogo de funcionalidades reutilizables
- shared/knowledge-base: Base de conocimiento compartida
- devtools/scripts: Herramientas de desarrollo
- control-plane/registries: Control de servicios y CI/CD
- orchestration/: Configuracion de orquestacion de agentes

Proyectos incluidos (11):
- gamilit (submodule -> GitHub)
- trading-platform (OrbiquanTIA)
- erp-suite con 5 verticales:
  - erp-core, construccion, vidrio-templado
  - mecanicas-diesel, retail, clinicas
- betting-analytics
- inmobiliaria-analytics
- platform_marketing_content
- pos-micro, erp-basico

Configuracion:
- .gitignore completo para Node.js/Python/Docker
- gamilit como submodule (git@github.com:rckrdmrd/gamilit-workspace.git)
- Sistema de puertos estandarizado (3005-3199)

Generated with NEXUS v3.4 Migration System
EPIC-010: Configuracion Git y Repositorios
2026-01-04 03:37:42 -06:00

139 lines
4.2 KiB
YAML

# ==============================================================================
# GITHUB ACTIONS CI TEMPLATE - Control Plane
# ==============================================================================
# Proposito: Template base para workflows de CI/CD
# Uso: Copiar a .github/workflows/ del proyecto y personalizar
# ==============================================================================
name: CI - {{SERVICE_NAME}}
on:
push:
branches: [main, develop]
paths:
- '{{SERVICE_PATH}}/**'
- '.github/workflows/{{SERVICE_NAME}}-ci.yml'
pull_request:
branches: [main, develop]
paths:
- '{{SERVICE_PATH}}/**'
env:
SERVICE_NAME: '{{SERVICE_NAME}}'
PROJECT_NAME: '{{PROJECT_NAME}}'
NODE_VERSION: '20'
jobs:
# ============================================================================
# JOB 1: VALIDATE
# ============================================================================
validate:
name: Validate Registries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate Ports
run: |
chmod +x control-plane/devtools/scripts/validation/validate-ports.sh
./control-plane/devtools/scripts/validation/validate-ports.sh
- name: Validate Service Descriptors
run: |
chmod +x control-plane/devtools/scripts/validation/validate-service-descriptors.sh
./control-plane/devtools/scripts/validation/validate-service-descriptors.sh
# ============================================================================
# JOB 2: BUILD & TEST
# ============================================================================
build:
name: Build & Test
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: '{{SERVICE_PATH}}/package-lock.json'
- name: Install dependencies
working-directory: '{{SERVICE_PATH}}'
run: npm ci
- name: Lint
working-directory: '{{SERVICE_PATH}}'
run: npm run lint
- name: Build
working-directory: '{{SERVICE_PATH}}'
run: npm run build
- name: Test
working-directory: '{{SERVICE_PATH}}'
run: npm run test:ci || true
- name: Upload coverage
if: always()
uses: codecov/codecov-action@v3
with:
directory: '{{SERVICE_PATH}}/coverage'
flags: ${{ env.SERVICE_NAME }}
# ============================================================================
# JOB 3: DOCKER BUILD (solo en main)
# ============================================================================
docker:
name: Docker Build
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: '{{SERVICE_PATH}}'
push: true
tags: |
ghcr.io/${{ github.repository }}/${{ env.SERVICE_NAME }}:${{ github.sha }}
ghcr.io/${{ github.repository }}/${{ env.SERVICE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
# ============================================================================
# JOB 4: DEPLOY (solo en tags)
# ============================================================================
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: docker
if: startsWith(github.ref, 'refs/tags/v')
environment: production
steps:
- name: Deploy to production
run: |
echo "Deploying ${{ env.SERVICE_NAME }} to production"
# Add deployment commands here