No description
Forgejo's act_runner ignores `on.workflow_call.secrets` declarations entirely. Secrets must be forwarded by the caller via `jobs.<id>.secrets:` per https://codeberg.org/forgejo/forgejo/pulls/10627. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| README.md | ||
chattyness-public/ci-actions
Reusable Forgejo Actions workflows shared across the chattyness Rust apps.
Workflows
build-and-push-image.yaml
Builds a Rust app image via the consumer's devops/build-image.sh (which
sources /usr/local/lib/buildah-helpers/lib.sh from leptos-builder) and
pushes it to the Forgejo registry.
Targets the cluster of repos that compile musl-static binaries with
leptos-builder:
- content-gen
- game-server
- chattyness (release + debug)
- avif-service
Out of scope (each keeps its own workflow): chattyness-db, leptos-builder.
Inputs
| Name | Required | Type | Default | Notes |
|---|---|---|---|---|
image_name |
yes | string | — | Image name (no tag); tag derived from trigger. |
build_command |
yes | string | — | e.g. devops/build-image.sh release. Receives --tag NAME:TAG appended. |
clone_siblings |
no | string (multi-line) | "" |
Newline-delimited list of sibling repos to clone for path = "../<repo>/..." workspace deps. Each line: <owner>/<repo>[@<ref>][:<dest>]. <ref> defaults to main; <dest> defaults to ../<repo>. Blank lines and #-comments are skipped. Uses masked REPO_TOKEN. |
rustflags |
no | string | "" |
Extra RUSTFLAGS (e.g. --cfg=web_sys_unstable_apis). |
sccache is always enabled (GHA backend via Forgejo's ACTIONS_CACHE_URL).
Secrets (use secrets: inherit in the consumer)
| Name | Required | Purpose |
|---|---|---|
REGISTRY_TOKEN |
yes | Pull leptos-builder; push the built image. |
FORGEJO_TOKEN |
yes | Clone consumer repo. |
REPO_TOKEN |
no | Optional secondary clone token (chattyness needs game-server). |
Consumer examples
content-gen — simplest case
name: Build content-gen Image
on:
push: { branches: [main], paths: ['src/**', 'Cargo.toml', 'Cargo.lock', 'devops/build-image.sh', '.forgejo/workflows/build-image.yaml'] }
pull_request: { branches: [main] }
workflow_dispatch:
jobs:
build:
uses: chattyness-public/ci-actions/.forgejo/workflows/build-and-push-image.yaml@v1
with:
image_name: content-gen
build_command: devops/build-image.sh release
secrets: inherit
avif-service — same shape as content-gen
name: Build avif-service Image
on:
push: { branches: [main], paths: ['src/**', 'Cargo.toml', 'Cargo.lock', 'devops/build-image.sh', '.forgejo/workflows/build-image.yaml'] }
pull_request: { branches: [main] }
workflow_dispatch:
jobs:
build:
uses: chattyness-public/ci-actions/.forgejo/workflows/build-and-push-image.yaml@v1
with:
image_name: avif-service
build_command: devops/build-image.sh release
secrets: inherit
game-server
name: CI
on:
push: { branches: [main], paths: ['src/**', 'crates/**', 'style/**', 'public/**', 'Cargo.toml', 'Cargo.lock', 'devops/build-image.sh', '.forgejo/workflows/ci.yaml'] }
pull_request: { branches: [main] }
workflow_dispatch:
jobs:
build:
uses: chattyness-public/ci-actions/.forgejo/workflows/build-and-push-image.yaml@v1
with:
image_name: game-server
build_command: devops/build-image.sh release
secrets: inherit
chattyness — needs sibling game-server (+ content-gen) clones
name: Build App Images (Release)
on:
push: { branches: [main], paths: ['apps/**', 'crates/**', 'Cargo.toml', 'Cargo.lock', 'devops/build-image.sh', 'prod.config.toml', '.forgejo/workflows/build-images-release.yaml'] }
pull_request: { branches: [main] }
workflow_dispatch:
jobs:
build:
uses: chattyness-public/ci-actions/.forgejo/workflows/build-and-push-image.yaml@v1
with:
image_name: chattyness-app-release
build_command: devops/build-image.sh release
rustflags: "--cfg=web_sys_unstable_apis"
clone_siblings: |
coworkunion/game-server
coworkunion/content-gen
secrets: inherit
Versioning
Pin consumers to @v1. Breaking changes get @v2 plus a migration note.
Never let consumers pin to @main.
Smoke-testing workflow_call on Forgejo
Before migrating all 5 consumers, confirm workflow_call works on this
Forgejo instance:
- Push this repo with the workflow file above.
- Create a tag
v1pointing atmain. - Migrate ONE consumer (suggest content-gen, smallest blast radius).
- Push a no-op change. Confirm CI runs, pulls the reusable workflow, builds, and pushes the image.
- If it works, migrate the remaining four.
- If
secrets: inheritdoesn't honor REPO_TOKEN for chattyness, enumerate each secret explicitly in the consumer'ssecrets:block.