feat(actions): add brencher reusable GitHub Action #33

Open
hermes wants to merge 1 commits from hermes/brencher:feature/reusable-brencher-action into main_corrupted
Contributor

What

Adds .github/actions/brencher/action.yml -- a composite reusable GitHub Action that:

  1. Resolves the image tag from the current commit SHA (auto-<sha>).
  2. Logs in to the configured Docker registry.
  3. Builds the image with BuildKit and pushes it to the registry (with auto-<sha> and latest tags, plus a buildcache for layer reuse).
  4. SSHes to the swarm manager, fetches the configured deploy branch, and runs docker stack deploy --prune --resolve-image-always -c <compose> <stack>.

Designed to be invoked from per-repo .github/workflows/deploy.yml files that watch for PR approval events.

Why

First step toward replacing brencher's manual UI-driven deploy loop with auto-deploy on PR approval (see #24 for the design discussion).

The action encapsulates the build + push + deploy pipeline as a reusable unit so any watched repo can wire it into its own workflow with a few with: inputs.

Companion PR

admin/reverseproxy (the torrserv_proxy stack) gets a .github/workflows/deploy.yml that invokes this action on PR approval. End-to-end pilot.

Open items (resolved empirically during pilot)

  • Where deploy_branches live on the swarm manager filesystem: assumed /opt/brencher-stacks/<stack_name> with the repo cloned at the configured deploy branch. If the layout differs in practice, the deploy step needs adjusting.
  • Secrets: REGISTRY_USERNAME, REGISTRY_PASSWORD, SWARM_MANAGER_HOST, SWARM_SSH_USER, SWARM_SSH_KEY -- need to be created in each watched repo.
## What Adds `.github/actions/brencher/action.yml` -- a composite reusable GitHub Action that: 1. Resolves the image tag from the current commit SHA (`auto-<sha>`). 2. Logs in to the configured Docker registry. 3. Builds the image with BuildKit and pushes it to the registry (with `auto-<sha>` and `latest` tags, plus a `buildcache` for layer reuse). 4. SSHes to the swarm manager, fetches the configured deploy branch, and runs `docker stack deploy --prune --resolve-image-always -c <compose> <stack>`. Designed to be invoked from per-repo `.github/workflows/deploy.yml` files that watch for PR approval events. ## Why First step toward replacing brencher's manual UI-driven deploy loop with auto-deploy on PR approval (see #24 for the design discussion). The action encapsulates the build + push + deploy pipeline as a reusable unit so any watched repo can wire it into its own workflow with a few `with:` inputs. ## Companion PR `admin/reverseproxy` (the `torrserv_proxy` stack) gets a `.github/workflows/deploy.yml` that invokes this action on PR approval. End-to-end pilot. ## Open items (resolved empirically during pilot) - Where deploy_branches live on the swarm manager filesystem: assumed `/opt/brencher-stacks/<stack_name>` with the repo cloned at the configured deploy branch. If the layout differs in practice, the deploy step needs adjusting. - Secrets: `REGISTRY_USERNAME`, `REGISTRY_PASSWORD`, `SWARM_MANAGER_HOST`, `SWARM_SSH_USER`, `SWARM_SSH_KEY` -- need to be created in each watched repo.
hermes added 1 commit 2026-08-31 16:50:23 +02:00
feat(actions): add brencher reusable GitHub Action
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 46s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 39s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 37s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 36s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 29s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 31s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Successful in 1m43s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Successful in 1m33s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Successful in 1m50s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 37s
Python package / build (pip list, 3.13) (pull_request) Successful in 33s
Python package / build (pip list, 3.14) (pull_request) Successful in 30s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.12.3) (pull_request) Successful in 32s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.13) (pull_request) Successful in 32s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.14) (pull_request) Successful in 34s
71a9e1b06b
Adds .github/actions/brencher/action.yml — a composite reusable
GitHub Action that builds a Docker image, pushes it to a registry,
and deploys a Docker Compose stack to a Swarm cluster via SSH.

Designed to be invoked from per-repo workflows that watch for PR
approval events; the caller supplies registry credentials, swarm
manager SSH details, and the stack / image names.

Companion PR in admin/reverseproxy wires this action into the
torrserv_proxy stack as the first end-to-end pilot.
hermes force-pushed feature/reusable-brencher-action from 175e32b07e to 71a9e1b06b 2026-08-31 16:50:23 +02:00 Compare
All checks were successful
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 46s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 39s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 37s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 36s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 29s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 31s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Successful in 1m43s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Successful in 1m33s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Successful in 1m50s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 37s
Python package / build (pip list, 3.13) (pull_request) Successful in 33s
Python package / build (pip list, 3.14) (pull_request) Successful in 30s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.12.3) (pull_request) Successful in 32s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.13) (pull_request) Successful in 32s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.14) (pull_request) Successful in 34s
Checking for merge conflicts…
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u https://gitea.rudolf.keenetic.link/hermes/brencher feature/reusable-brencher-action:hermes-feature/reusable-brencher-action
git checkout hermes-feature/reusable-brencher-action
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/brencher#33