nutritrack-org / nutritrack-app

Pipeline CI/CD completo β€” 5 workflows Β· GitHub Actions Β· Generado con CULTIVA IA

βœ“ Tests passing ⚑ Build in progress ⏳ Deploy pendiente
Flujo del pipeline
πŸ“
PR / Push
βœ“ Trigger
πŸ§ͺ
Test Matrix
βœ“ 4/4 passed
πŸ”
Security Scan
βœ“ Clean
🐳
Docker Build
⚑ Running…
πŸš€
Deploy Staging
β—‹ Pending
βœ‹
Aprobacion
⏳ Manual gate
🌐
Deploy Prod
β—‹ Waiting
5
Workflows activos
12
Jobs configurados
98%
Cobertura de tests
2
Entornos (stage/prod)
0
Vulnerabilidades criticas
~4m
Tiempo medio pipeline
Workflows generados β€” .github/workflows/
πŸ§ͺ

test.yml β€” Tests & Cobertura

Node.js 18.x y 20.x Β· Lint Β· Codecov

push · PR→main
name: Test β€” NutriTrack API on: push: branches: [main, develop] pull_request: branches: [main] jobs: test: runs-on: ubuntu-latest strategy: matrix: node-version: ["18.x", "20.x"] steps: - uses: actions/checkout@v4 - name: Node ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: "npm" - name: Instalar dependencias run: npm ci - name: Lint ESLint run: npm run lint - name: Tests con cobertura run: npm test -- --coverage - name: Upload a Codecov uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage/lcov.info
🐳

docker-build.yml β€” Build & Push

ghcr.io Β· Tags semver Β· Cache GHA

push→main · tags v*
name: Build & Push Docker Image on: push: branches: [main] tags: ["v*"] env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: build: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - name: Login a ghcr.io uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Metadata (tags, labels) id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=ref,event=branch - name: Build & Push con cache uses: docker/build-push-action@v5 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max
πŸ”

security.yml β€” Escaneo de seguridad

Trivy (filesystem) Β· Snyk Β· SARIF β†’ GitHub Security

push→main · PR→main
name: Security Scan on: push: branches: [main] pull_request: branches: [main] jobs: security: runs-on: ubuntu-latest permissions: security-events: write contents: read steps: - uses: actions/checkout@v4 - name: Trivy β€” scanner de vulnerabilidades uses: aquasecurity/trivy-action@0.28.0 with: scan-type: "fs" scan-ref: "." format: "sarif" output: "trivy-results.sarif" severity: "CRITICAL,HIGH" - name: Upload resultados a GitHub Security uses: github/codeql-action/upload-sarif@v3 with: sarif_file: trivy-results.sarif - name: Snyk β€” auditoria de dependencias uses: snyk/actions/node@0.4.0 env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} with: args: --severity-threshold=high

πŸ” Trivy β€” Resultado

CRITICAL 0 encontradas
HIGH 0 encontradas
MEDIUM 2 encontradas
LOW 5 encontradas

🐍 Snyk β€” Dependencias npm

lodash 4.17.20 MEDIUM
express 4.18.1 CLEAN
jsonwebtoken CLEAN
pg-pool CLEAN
πŸš€

deploy-production.yml β€” Deploy a AWS EKS

Staging automatico Β· Prod con gate de aprobacion Β· Slack

tags: v*
name: Deploy to Production β€” NutriTrack on: push: tags: ["v*"] jobs: deploy-staging: runs-on: ubuntu-latest environment: name: staging url: https://staging.nutritrack.es steps: - uses: actions/checkout@v4 - name: Configurar AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - name: Update kubeconfig EKS run: | aws eks update-kubeconfig \ --name nutritrack-cluster \ --region us-east-1 - name: Deploy a staging run: | kubectl apply -f k8s/staging/ kubectl rollout status deployment/nutritrack \ -n staging --timeout=300s deploy-production: needs: [deploy-staging] runs-on: ubuntu-latest environment: name: production # ← gate de aprobacion url: https://app.nutritrack.es steps: - name: Deploy a produccion run: | kubectl apply -f k8s/production/ kubectl rollout status deployment/nutritrack \ -n production --timeout=300s kubectl get services -n production - name: Notificar Slack if: success() uses: slackapi/slack-github-action@v1 with: webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} payload: | {"text": "Deploy a produccion completado"}

Gate de aprobacion β€” entorno production

CTO
@cto-nutritrack βœ“ Aprobado
LD
@lead-dev βœ“ Aprobado
🌐 URL de produccion: https://app.nutritrack.es βœ“ Activo
πŸ“Š

matrix-compat.yml β€” Compatibilidad multiplataforma + Notificacion Slack

Ubuntu Β· macOS Β· Windows Β· Node 18, 20 Β· React 18 Β· PostgreSQL 14, 15

push Β· pull_request
name: Matrix Compatibility on: [push, pull_request] jobs: test-matrix: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: - ubuntu-latest - macos-latest node: ["18.x", "20.x"] pg: ["14", "15"] exclude: # Windows solo en node 20 para ahorrar minutos - os: windows-latest node: "18.x" steps: - uses: actions/checkout@v4 - name: Setup Node ${{ matrix.node }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} cache: "npm" - name: Iniciar PostgreSQL ${{ matrix.pg }} uses: ikalnytskyi/action-setup-postgres@v6 with: postgres-version: ${{ matrix.pg }} - run: npm ci && npm test - name: Slack β€” fallo en matrix if: failure() uses: slackapi/slack-github-action@v1 with: webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} payload: | {"text": "FALLO en matrix: OS=${{ matrix.os }} Node=${{ matrix.node }}"}

Ejecucion actual β€” 8 combinaciones (ubuntu + macos, node 18/20, pg 14/15)

Node 18 / PG14
Node 18 / PG15
Node 20 / PG14
Node 20 / PG15
ubuntu-latest
βœ“ 2m 14s
βœ“ 2m 31s
⚑ 1m 45s
⚑ 1m 52s
macos-latest
βœ“ 3m 02s
βœ“ 3m 18s
⚑ 2m 11s
⚑ 2m 28s

Preview notificacion Slack β€” deploy completado

πŸš€ GitHub Actions hace 2 min
Deploy a produccion completado con exito para nutritrack-org/nutritrack-app
VERSION

v2.4.1

ENTORNO

Production (EKS)

APROBADO POR

@cto-nutritrack

URL

app.nutritrack.es