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 /*.md files are generated # from /_templates/*.md + /_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 /*.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 /*.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 "ci@h2w.hu" 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