Switch to composite actions (Forgejo 11 lacks workflow_call)

This commit is contained in:
Noah Holt 2026-08-10 21:48:08 -05:00
parent 46bcafb9cb
commit 753a3b37de
6 changed files with 141 additions and 118 deletions

View file

@ -1,13 +1,44 @@
# workflows
Reusable Forgejo Actions workflows for the homelab pipeline.
Shared composite actions for the homelab CI/CD pipeline. (Composite
actions, not reusable workflows: Forgejo LTS 11 does not support
`on: workflow_call`.)
- `build-and-deploy.yaml` — language-agnostic: docker build -> push to the
Forgejo registry (`192.168.1.230:3000`) -> bump the image tag in
`nholtware/gitops` (ArgoCD takes it from there). Inputs: `app-name`
(required), `context`, `dockerfile`, `gitops-repo`.
- `node-checks.yaml` — optional TypeScript/Node checks: `npm ci`, lint,
test (each `--if-present`).
- `node-checks` — npm ci + lint + test (each `--if-present`)
- `build-push` — docker build + push to the Forgejo registry
(`192.168.1.230:3000`), tags `<short-sha>` + `latest`
- `gitops-bump` — set the image tag in `nholtware/gitops` via
`kustomize edit set image`; ArgoCD deploys from there
Secrets expected (user/org-level Actions secrets): `REGISTRY_USER`,
`REGISTRY_TOKEN` (write:package), `GITOPS_TOKEN` (write to gitops repo).
A consuming app's `.forgejo/workflows/ci.yaml` (see nholtware/demo-app):
```yaml
on:
push:
branches: [main]
jobs:
checks:
runs-on: docker
steps:
- uses: actions/checkout@v4
- uses: http://192.168.1.230:3000/nholtware/workflows/node-checks@main
deploy:
needs: checks
runs-on: host
steps:
- uses: actions/checkout@v4
- uses: http://192.168.1.230:3000/nholtware/workflows/build-push@main
with:
app-name: my-app
registry-user: ${{ secrets.REGISTRY_USER }}
registry-token: ${{ secrets.REGISTRY_TOKEN }}
- uses: http://192.168.1.230:3000/nholtware/workflows/gitops-bump@main
with:
app-name: my-app
gitops-token: ${{ secrets.GITOPS_TOKEN }}
```
Secrets are user-level Actions secrets on the repo owner: `REGISTRY_USER`,
`REGISTRY_TOKEN` (write:package), `GITOPS_TOKEN` (write on the gitops repo).
For a non-Node app, drop the `checks` job (or swap in your own) — `deploy`
is language-agnostic.