Files
clusterlogs/.gitea/workflows/ci.yml
T
fernando 2446c1ccfa
CI / test-and-build (push) Successful in 12s
ci: simplificar condición del paso de despliegue para aislar el bug
Prueba si el operador && en la expresión if: es lo que causa que el
runner omita el paso sin dejar rastro; se reduce a una sola comparación.
2026-08-18 00:41:12 -06:00

79 lines
2.1 KiB
YAML

name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Instalar Zola fijado
run: |
mkdir -p "$HOME/.local/bin"
curl -sL "https://github.com/getzola/zola/releases/download/v0.23.3/zola-v0.23.3-x86_64-unknown-linux-gnu.tar.gz" -o /tmp/zola.tar.gz
tar xz -C "$HOME/.local/bin" -f /tmp/zola.tar.gz zola
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/zola" --version
- name: Preparar tema fijado
run: ./scripts/bootstrap-theme.sh
- name: Formato Go
run: test -z "$(gofmt -l cmd internal)"
- name: Pruebas Go
run: go test ./...
- name: Detector de carreras Go
run: go test -race ./...
- name: Análisis estático Go
run: go vet ./...
- name: Compilar CLI
run: make build
- name: Flujo integral de la CLI
run: ./scripts/e2e-local.sh
- name: Verificar firmas SSH de commits del pull request
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: ./scripts/verify-signatures-ci.sh
- name: Regenerar y comprobar proyección
run: |
./bin/clusterlog --root . sync
./bin/clusterlog --root . sync --check
- name: Validar contenido y plantillas
run: ./bin/clusterlog --root . validate --require-zola
- name: Construir sitio
run: zola build
- name: Depurar contexto de despliegue
run: echo "ref=${{ github.ref }} event=${{ github.event_name }} ref_name=${{ github.ref_name }}"
- name: Publicar en producción (clusterlog.mcps-epcm.org)
if: ${{ github.ref_name == 'main' }}
run: rsync -a --delete public/ /opt/clusterlog/public/
- name: Fin del pipeline
run: echo "listo"