No description
Find a file Use this template
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jontil88 b9e454097e
Some checks failed
docker-deploy.yml / feat(docker-deploy): append declared secrets instead of overwriting env file (push) Failing after 0s
node-ci.yml / feat(docker-deploy): append declared secrets instead of overwriting env file (push) Failing after 0s
python-ci.yml / feat(docker-deploy): append declared secrets instead of overwriting env file (push) Failing after 0s
static-ftp-deploy.yml / feat(docker-deploy): append declared secrets instead of overwriting env file (push) Failing after 0s
trivy-scan.yml / feat(docker-deploy): append declared secrets instead of overwriting env file (push) Failing after 0s
feat(docker-deploy): append declared secrets instead of overwriting env file
Bisher: '> $OUT' (overwrite). Kolidierte mit Caller-Setups, die in einem
pre-job eigene Secrets vor-rendern wollten (z.B. MOLLIE_API_KEY, das nicht
im Slot-Set ist).

Jetzt: '> $OUT.tmp && mv' mit 'cat $OUT' zuerst, falls vorhanden.
Effekt: Caller kann eine Env-Datei vor-rendern, der Reusable ergaenzt
seine deklarierten Slots. Wenn keine Datei existiert, wird sie neu
angelegt (kein Breaking Change).

Aufrufer-Pattern:
  setup-env job (runs-on: vps-runner) → schreibt /opt/<repo>/.env mit
  MOLLIE_API_KEY etc. → deploy job ruft docker-deploy.yml mit
  runtime-env-file: '/opt/<repo>/.env'.

Phase 2 refactor 2026-09-17.
2026-09-17 14:05:25 +02:00
.forgejo/workflows feat(docker-deploy): append declared secrets instead of overwriting env file 2026-09-17 14:05:25 +02:00
scripts fix(sha): correct stale SHAs for actions/checkout and actions/setup-node 2026-09-17 13:07:15 +02:00
.gitignore Initial templates: python-ci, node-ci, docker-deploy, static-ftp-deploy, trivy-scan 2026-09-17 13:02:49 +02:00
ACTION_VERSIONS.md fix(sha): correct stale SHAs for actions/checkout and actions/setup-node 2026-09-17 13:07:15 +02:00
README.md Initial templates: python-ci, node-ci, docker-deploy, static-ftp-deploy, trivy-scan 2026-09-17 13:02:49 +02:00

morri/_forgejo-templates

Reusable Forgejo Actions workflows (compatible with GitHub Actions semantics) for all production-deployed repos under morri/* on git.buengener-solution.de.

Public or private?

This is the public flavour. It contains no secrets, no repo-internal details, only generic enterprise patterns (concurrency, SHA-pinned actions, smoke tests, image scanning). Any caller repo can uses: these without extra auth setup.

For organisation-internal helpers that require private Forgejo access (prisma-deploy.yml with DB credentials, token audit), see the companion repo morri/_forgejo-templates-private (planned, Phase 0b).

Reusable workflows

File Purpose Current / planned callers
python-ci.yml Python repos: lint, compile, import smoke, tests krb_tetraguard, freelancer-automation
node-ci.yml Node/Next.js repos: lint, typecheck, tests, build buengener-*, buengener-portal, KiDara-frontend
docker-deploy.yml Docker container on host runner: build, scan, deploy, smoke, rollback buengener-software, buengener-solution, buengener-portal
static-ftp-deploy.yml Static site via lftp/FTPS to Hostinger hotel-obermaubach, bsv-kreuzau
trivy-scan.yml Standalone Trivy image scanner (CRITICAL blocks, HIGH report-only) any image-build pipeline

How to use

In the caller's .forgejo/workflows/<name>.yml:

on:
  push:
    branches: [main]
  workflow_dispatch:

concurrency:
  group: deploy-prod-${{ github.repository }}
  cancel-in-progress: false

jobs:
  deploy:
    uses: morri/_forgejo-templates/.forgejo/workflows/docker-deploy.yml@v1
    with:
      image-name: 'buengener-website'
      deploy-dir: '/opt/buengener-website'
      container-network: 'matrix_default'
      health-url: 'https://buengener-software.de'
      build-args: 'AUTH_SECRET'
    secrets:
      DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
      AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
      SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
      WEBHOOK_URL: ${{ secrets.ALERT_WEBHOOK }}

Version pinning:

  • Pin to a specific tag (@v1.2.0) for production deploy workflows — strict, no surprises.
  • Pin to a major tag (@v1) for CI-only workflows where auto-minor updates are welcome.
  • Never pin to @main or @master in a caller.

Action versioning

All third-party Actions are SHA-pinned. The mapping SHA → semver is tracked in ACTION_VERSIONS.md. To bump an Action:

  1. Check upstream for a new release: git ls-remote https://github.com/OWNER/REPO refs/tags/vX.Y.Z
  2. Update the SHA in the workflow file (both the uses: and ACTION_VERSIONS.md)
  3. Bump the templates-repo tag (v1.x.y) and push
  4. Update all callers' pinned versions

Automation helper: ./scripts/update-action-shas.sh rewrites the inline SHA comments across all workflow files in one pass.

Caller prerequisites

  • Forgejo 15.0.3+ on the instance (this is the version running on git.buengener-solution.de — supports workflow_call).
  • The runner labels referenced by the reusable (vps-runner, docker, kidara) must exist on the caller's runner. See 04-System/forgejo-setup.md in the morri-vault for the current runner topology.
  • All secrets referenced by the reusable must be configured in the caller's repo settings (Forgejo → Repo → Settings → Secrets).

Changelog

CHANGELOG.md will be created on first release. Until then, see commit history.