fix: manifest check in Node (python3 absent on slim runner)
All checks were successful
Build and deploy Havenllo / Verify Go and frontend (push) Successful in 32s
Build and deploy Havenllo / Build and push image (push) Successful in 40s
Build and deploy Havenllo / Apply and restart Havenllo (push) Successful in 6s

This commit is contained in:
Hermes
2026-07-14 10:19:44 -03:00
parent 77a2a7e003
commit d4b5cc283c

View File

@@ -37,28 +37,18 @@ jobs:
- name: Validate Kubernetes manifest
run: |
# 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
# in the deploy job using the KUBE_CONFIG secret. Node is already
# installed in the verify job, so use it (no python on the slim image).
node -e '
const fs = require("fs");
const txt = fs.readFileSync("deploy/havenllo.yaml", "utf8");
const docs = txt.split(/\n---\n/).map(s => s.trim()).filter(Boolean);
const kinds = docs.map(d => { const m = d.match(/^kind:\s*(\S+)/m); return m ? m[1] : null; });
const req = ["PersistentVolumeClaim", "Deployment", "Service", "Ingress"];
const miss = req.filter(k => !kinds.includes(k));
console.log("docs:", docs.length, "kinds:", kinds.join(", "));
if (miss.length) { console.error("MISSING KINDS:", miss.join(", ")); process.exit(1); }
'
build:
name: Build and push image
needs: verify