No description
Find a file
Evan Carroll 3454ddadfb fix: drop on.workflow_call.secrets — forgejo#10627 workaround
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>
2026-06-15 02:25:30 -05:00
.forgejo/workflows fix: drop on.workflow_call.secrets — forgejo#10627 workaround 2026-06-15 02:25:30 -05:00
README.md feat: plural clone_sibling_repo 2026-06-14 17:39:06 -05:00

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:

  1. Push this repo with the workflow file above.
  2. Create a tag v1 pointing at main.
  3. Migrate ONE consumer (suggest content-gen, smallest blast radius).
  4. Push a no-op change. Confirm CI runs, pulls the reusable workflow, builds, and pushes the image.
  5. If it works, migrate the remaining four.
  6. If secrets: inherit doesn't honor REPO_TOKEN for chattyness, enumerate each secret explicitly in the consumer's secrets: block.