Files
H2W-Public-Legal/.gitea/workflows/legal-manifest.yml
Your NameandClaude Sonnet 5 df3c5df988 CI: sablon-feloldás automatizálása; tárhely átírása bérelt szerverre
A CI mostantól a build-manifest.py előtt lefuttatja a render-templates.py-t,
és a feloldott dokumentumokat is visszacommitolja a manifest+HTML mellé —
mostantól a _data.json / _templates szerkesztése önmagában elég, nem kell
kézzel futtatni és commitolni a render-templates.py-t. A trigger
paths-ignore-ja kiegészült a '*/*.md' mintával (a generált fájlok
commit-backje ne indítson újabb buildet), a _templates/ almappa mélyebben
van, így ez nem szűri ki a tényleges szerkesztéseket.

A "saját tulajdonú hardver" megfogalmazás mind a 4 dokumentumban javítva
"a Nethely Kft.-től bérelt szerver"-re — a tényleges konstrukció klasszikus
szerverbérlés, nem a Szolgáltató tulajdonában lévő, kolokált hardver.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-05 21:52:46 +02:00

77 lines
3.9 KiB
YAML

name: Build legal manifest
# HT-14: renders every project's legal markdown to HTML and produces
# dist/legal-manifest.json — the single canonical source HT-15's consumer backends import,
# so no one hashes/versions independently. See scripts/build-manifest.py for the actual
# logic (and why there's no PDF step); this workflow just provides the environment it needs.
#
# Also resolves scripts/render-templates.py: the tracked <project>/*.md files are generated
# from <project>/_templates/*.md + <project>/_data.json (single-sourced repeated data like
# the provider's identity or sub-processor list — see the repo README). Editors touch the
# templates/data, not the tracked .md; CI resolves and commits the result, same pattern as
# the manifest/HTML commit-back below.
on:
push:
branches: [main]
# Avoids the commit-back step (below) re-triggering itself. '*/*.md' matches only a
# project's top-level, generated *.md files (e.g. H2W-Ticketing/aszf.md) — NOT
# H2W-Ticketing/_templates/*.md, which is one level deeper and must still trigger a
# rebuild when a human edits it.
paths-ignore: [manifest/**, '*/*.md']
workflow_dispatch: {}
jobs:
build-manifest:
runs-on: ubuntu-latest
steps:
- name: Checkout (full history)
uses: actions/checkout@v4
with:
# NOT the default shallow clone: scripts/build-manifest.py's per-file
# `git log -1 -- path` needs real history, or every file silently resolves to
# whatever the one shallow commit happens to be (see HT-15 belépő ellenőrzés).
fetch-depth: 0
# The CI environment: a plain ubuntu-latest job container (act_runner default image),
# with pandoc (markdown -> HTML, per HT-14) installed as an explicit step — not baked
# into a custom runner image, so the environment stays visible and reproducible
# directly from this file.
- name: Install pandoc
run: apt-get update -qq && apt-get install -y --no-install-recommends pandoc python3
# Resolves _templates/*.md + _data.json into the tracked <project>/*.md files, so a
# single-source data edit (e.g. a changed address) reaches every document that
# references it before build-manifest.py hashes and renders them. Pure stdlib, no
# extra install step needed. No-op for a project without a _templates/ dir.
- name: Sablonok feloldása (_templates + _data.json -> *.md)
run: python3 scripts/render-templates.py
- name: Build manifest
run: python3 scripts/build-manifest.py
# The rendered HTML is now small (no PDF, see build-manifest.py) — committing the
# whole dist/ output back to the repo consumers already git-clone for the markdown
# sources is cheap and avoids the Gitea Actions artifact API entirely (its repo-level
# list-artifacts endpoint returned empty even after a confirmed-successful upload in
# an earlier version of this workflow — a REST API gap, not worth depending on).
#
# The resolved *.md files are committed alongside the manifest for the same reason:
# consumers (H2W_Ticketing_home, ResidentFirst) git-clone this repo and read the
# top-level <project>/*.md directly, never _templates/ — so the resolved text must be
# what's actually sitting on main, not just re-derivable from it.
- name: Commit feloldott dokumentumok + manifest + renderelt HTML vissza a repóba
run: |
rm -rf manifest
cp -r dist manifest
git config user.name "H2W Legal CI"
git config user.email "[email protected]"
git add manifest
git add -- '*/*.md'
if git diff --cached --quiet; then
echo "Nincs mit commitolni — a feloldott dokumentumok és a manifest változatlanok."
else
git commit -m "CI: jogi dokumentumok feloldva + legal-manifest.json + renderelt HTML frissítve [skip ci]"
git push origin HEAD:main
fi