ci: extract Reload Caddy step into a composite action #539

Open
opened 2026-05-11 22:54:55 +02:00 by marcel · 0 comments
Owner

Context

The Reload Caddy step (privileged Alpine container + nsenter) is currently duplicated identically in nightly.yml and release.yml. Both workflows were updated in PR #537 to use a pinned Alpine digest and reload instead of restart.

Problem

Any future change — e.g. a Renovate bump to a newer Alpine digest, or a change to the nsenter flags — must be applied in two places. This is a maintenance risk.

Proposed solution

Extract the step into a local composite action at .gitea/actions/reload-caddy/action.yml:

name: Reload Caddy
description: Reload the host Caddy service via nsenter (DooD runner)
runs:
  using: composite
  steps:
    - name: Reload Caddy
      shell: bash
      run: |
        docker run --rm --privileged --pid=host \
          alpine:3.21@sha256:48b0309ca019d89d40f670aa1bc06e426dc0931948452e8491e3d65087abc07d \
          sh -c 'apk add --no-cache util-linux -q && nsenter -t 1 -m -u -n -p -i -- /bin/systemctl reload caddy'

Then both workflows call it with:

- uses: ./.gitea/actions/reload-caddy

Acceptance criteria

  • Composite action created at .gitea/actions/reload-caddy/action.yml
  • nightly.yml Reload Caddy step replaced with uses: ./.gitea/actions/reload-caddy
  • release.yml Reload Caddy step replaced with uses: ./.gitea/actions/reload-caddy
  • Nightly CI run passes after the change
  • docs/infrastructure/ci-gitea.md updated to reference the composite action

Notes

  • Gitea supports local composite actions via uses: ./.gitea/actions/<name> (same as GitHub Actions for local actions)
  • The step comment explaining the DooD rationale can live in the composite action's description field and in the action.yml inline comments — it does not need to be repeated in each calling workflow
## Context The `Reload Caddy` step (privileged Alpine container + nsenter) is currently duplicated identically in `nightly.yml` and `release.yml`. Both workflows were updated in PR #537 to use a pinned Alpine digest and `reload` instead of `restart`. ## Problem Any future change — e.g. a Renovate bump to a newer Alpine digest, or a change to the nsenter flags — must be applied in two places. This is a maintenance risk. ## Proposed solution Extract the step into a **local composite action** at `.gitea/actions/reload-caddy/action.yml`: ```yaml name: Reload Caddy description: Reload the host Caddy service via nsenter (DooD runner) runs: using: composite steps: - name: Reload Caddy shell: bash run: | docker run --rm --privileged --pid=host \ alpine:3.21@sha256:48b0309ca019d89d40f670aa1bc06e426dc0931948452e8491e3d65087abc07d \ sh -c 'apk add --no-cache util-linux -q && nsenter -t 1 -m -u -n -p -i -- /bin/systemctl reload caddy' ``` Then both workflows call it with: ```yaml - uses: ./.gitea/actions/reload-caddy ``` ## Acceptance criteria - [ ] Composite action created at `.gitea/actions/reload-caddy/action.yml` - [ ] `nightly.yml` Reload Caddy step replaced with `uses: ./.gitea/actions/reload-caddy` - [ ] `release.yml` Reload Caddy step replaced with `uses: ./.gitea/actions/reload-caddy` - [ ] Nightly CI run passes after the change - [ ] `docs/infrastructure/ci-gitea.md` updated to reference the composite action ## Notes - Gitea supports local composite actions via `uses: ./.gitea/actions/<name>` (same as GitHub Actions for local actions) - The step comment explaining the DooD rationale can live in the composite action's `description` field and in the `action.yml` inline comments — it does not need to be repeated in each calling workflow
marcel added the devops label 2026-05-11 22:55:00 +02:00
Sign in to join this conversation.
No Label devops
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#539