fix: replace cluster-dependent kubectl validate with offline YAML doc check
Some checks failed
Build and deploy Havenllo / Verify Go and frontend (push) Failing after 32s
Build and deploy Havenllo / Build and push image (push) Has been skipped
Build and deploy Havenllo / Apply and restart Havenllo (push) Has been skipped

This commit is contained in:
Hermes
2026-07-14 10:18:48 -03:00
parent 43df414c4d
commit 77a2a7e003

View File

@@ -36,9 +36,29 @@ jobs:
run: npm run build
- name: Validate Kubernetes manifest
run: |
if command -v kubectl >/dev/null 2>&1; then
kubectl apply --dry-run=client --validate=false -f deploy/havenllo.yaml
fi
# Offline check only: the runner has no cluster. The real apply happens
# in the deploy job using the KUBE_CONFIG secret.
python3 - <<'PY'
import sys, subprocess
try:
import yaml
except ImportError:
subprocess.run(["apk", "add", "--no-cache", "py3-yaml"], check=False)
import importlib
yaml = importlib.import_module("yaml")
kinds = []
with open("deploy/havenllo.yaml") as f:
for doc in yaml.safe_load_all(f):
if doc is None:
continue
kinds.append(doc.get("kind"))
required = ["PersistentVolumeClaim", "Deployment", "Service", "Ingress"]
missing = [k for k in required if k not in kinds]
if missing:
print("MISSING KINDS:", missing)
sys.exit(1)
print("manifest docs OK:", kinds)
PY
build:
name: Build and push image
needs: verify