Gitea Actions #15

Closed
opened 2026-04-04 05:50:55 +00:00 by greg · 6 comments
Owner

Stand up Gitea Actions:

  • Use the Gitea action runner to stand up a Kubernetes runner. Allowed images should be all currently supported Ubuntu versions, all currently supported Fedora versions, and all currently supported CentOS Stream versions. Also, a nixos/nix image runner should be made available, as well as selecting the images published by the greg/ci-images repository. These images are listed on this page.
  • Use Nix configuration to stand up a local shell runner on Jeremiah, Zeke, Isaiah, and Linode. Configure the runners so that each the host can be chosen specifically, or Isaiah/Jeremiah/Zeke can be selected with no preference between them. I need to be able to run things like my personal blog updates on Linode specifically, but some tasks that I want to run directly on bare metal, it doesn't matter if they are running on any of those hardware nodes.

Additionally:

  • Configure a cron job in this repository with Gitea Actions to detect the latest version of Helm charts and container images in my manifest directory. Have the cron job update those version pins and open an automated pull request against main when changes are detected
  • Configure another cron job to update the nix lock file in this repository. Have the job run weekly and open a PR against the main branch.
Stand up Gitea Actions: * Use the Gitea action runner to stand up a Kubernetes runner. Allowed images should be all currently supported Ubuntu versions, all currently supported Fedora versions, and all currently supported CentOS Stream versions. Also, a nixos/nix image runner should be made available, as well as selecting the images published by the greg/ci-images repository. These images are listed on [this page](https://src.thehellings.com/greg/-/packages). * Use Nix configuration to stand up a local shell runner on Jeremiah, Zeke, Isaiah, and Linode. Configure the runners so that each the host can be chosen specifically, or Isaiah/Jeremiah/Zeke can be selected with no preference between them. I need to be able to run things like my personal blog updates on Linode specifically, but some tasks that I want to run directly on bare metal, it doesn't matter if they are running on any of those hardware nodes. Additionally: * Configure a cron job in this repository with Gitea Actions to detect the latest version of Helm charts and container images in my `manifest` directory. Have the cron job update those version pins and open an automated pull request against main when changes are detected * Configure another cron job to update the nix lock file in this repository. Have the job run weekly and open a PR against the main branch.
klaatu was assigned by greg 2026-04-04 05:50:55 +00:00
Collaborator

Hey Greg! I've picked this up. Here's my plan of action:

Plan for Gitea Actions

1. Kubernetes Action Runner

I'll configure the Gitea Actions Kubernetes runner as a k3s workload (manifests in manifests/gitea-runner/). Allowed runner images will include:

  • Ubuntu — all currently supported LTS and interim releases (22.04, 24.04, 24.10, etc.)
  • Fedora — all currently supported releases
  • CentOS Stream — all currently supported versions (Stream 9, Stream 10)
  • nixos/nix — official Nix image
  • greg/ci-images — all images published at https://src.thehellings.com/greg/-/packages

2. Local Shell Runners (NixOS)

I'll add a NixOS module (modules/nixos/gitea-runner.nix) and configure act_runner as a systemd service on Jeremiah, Zeke, Isaiah, and Linode. Runner labels will be set so that:

  • Each host can be targeted specifically via its hostname label (e.g. runs-on: [self-hosted, jeremiah])
  • Isaiah/Jeremiah/Zeke share a common label (e.g. runs-on: [self-hosted, bare-metal]) for workloads where any hardware node is acceptable
  • Linode has its own label (e.g. runs-on: [self-hosted, linode]) for things like blog deployments

3. Helm/Container Version Update Cron

I'll add a .gitea/workflows/update-manifests.yaml workflow that:

  • Runs on a schedule (e.g. weekly or nightly)
  • Scans the manifests/ directory for Helm chart versions and container image tags
  • Checks for newer versions upstream
  • Opens an automated PR against main when updates are found

4. Nix Lockfile Update Cron

I'll add a .gitea/workflows/update-flake-lock.yaml workflow that:

  • Runs weekly
  • Runs nix flake update on the Nix runner
  • Opens a PR against main if flake.lock changed

I'll start by reviewing the existing manifests structure and the NixOS config to slot these in cleanly. I'll open PRs for each logical chunk rather than one giant change. Questions or preferences before I dive in?

Hey Greg! I've picked this up. Here's my plan of action: ## Plan for Gitea Actions ### 1. Kubernetes Action Runner I'll configure the [Gitea Actions Kubernetes runner](https://gitea.com/gitea/act_runner) as a k3s workload (manifests in `manifests/gitea-runner/`). Allowed runner images will include: - **Ubuntu** — all currently supported LTS and interim releases (22.04, 24.04, 24.10, etc.) - **Fedora** — all currently supported releases - **CentOS Stream** — all currently supported versions (Stream 9, Stream 10) - **nixos/nix** — official Nix image - **greg/ci-images** — all images published at https://src.thehellings.com/greg/-/packages ### 2. Local Shell Runners (NixOS) I'll add a NixOS module (`modules/nixos/gitea-runner.nix`) and configure `act_runner` as a systemd service on **Jeremiah, Zeke, Isaiah, and Linode**. Runner labels will be set so that: - Each host can be targeted specifically via its hostname label (e.g. `runs-on: [self-hosted, jeremiah]`) - Isaiah/Jeremiah/Zeke share a common label (e.g. `runs-on: [self-hosted, bare-metal]`) for workloads where any hardware node is acceptable - Linode has its own label (e.g. `runs-on: [self-hosted, linode]`) for things like blog deployments ### 3. Helm/Container Version Update Cron I'll add a `.gitea/workflows/update-manifests.yaml` workflow that: - Runs on a schedule (e.g. weekly or nightly) - Scans the `manifests/` directory for Helm chart versions and container image tags - Checks for newer versions upstream - Opens an automated PR against `main` when updates are found ### 4. Nix Lockfile Update Cron I'll add a `.gitea/workflows/update-flake-lock.yaml` workflow that: - Runs weekly - Runs `nix flake update` on the Nix runner - Opens a PR against `main` if `flake.lock` changed --- I'll start by reviewing the existing manifests structure and the NixOS config to slot these in cleanly. I'll open PRs for each logical chunk rather than one giant change. Questions or preferences before I dive in?
Collaborator

Acknowledged — Plan of Action

Thanks for the detailed spec, Greg. Here's my read-back and plan:


1. Gitea Actions Runner — Kubernetes (act_runner)

  • Deploy the Gitea act_runner as a Kubernetes workload (k3s on Isaiah/Jeremiah/Zeke)
  • Configure the runner to allow the following image classes:
    • Ubuntu: All currently supported LTS versions (22.04, 24.04, etc.)
    • Fedora: All currently supported releases
    • CentOS Stream: Active streams (9, 10)
    • NixOS/Nix: nixos/nix official image
    • Custom CI images: All packages published under greg/ci-images in Gitea Packages (builder, vm-test, sword-container-builder, bitwarden, immich) — sourced from src.thehellings.com
  • Add the runner manifest to manifests/ and configure it via NixOS/Colmena as appropriate

2. Local Shell Runners (NixOS module)

  • Add a NixOS module for the Gitea act_runner in shell mode
  • Deploy to: Jeremiah, Zeke, Isaiah, and Linode
  • Label/tag strategy:
    • Each host gets its own specific label (e.g., host:jeremiah, host:zeke, host:isaiah, host:linode)
    • Isaiah/Jeremiah/Zeke also share a common label (e.g., bare-metal) so jobs can target any of the three without preference
    • Linode gets only its own label so it can be targeted specifically (e.g., for blog deployments)
  • Secrets (runner tokens) will be managed via agenix

3. Cron: Helm Chart & Container Image Version Updates

  • Write a GitHub Actions-compatible workflow (.gitea/workflows/update-manifests.yaml) on a weekly or daily schedule
  • The job will:
    • Scan manifests/ for pinned Helm chart versions and container image tags
    • Query upstream (artifact hub, chart repos, container registries) for latest versions
    • If changes detected, create a branch and open a PR against main automatically
  • Run this on the Kubernetes runner

4. Cron: Nix Lockfile Update

  • Add .gitea/workflows/update-flake-lock.yaml — runs weekly
  • Job runs nix flake update on a NixOS/nix runner
  • If flake.lock changes, opens a PR against main
  • Should run on the nixos/nix image (Kubernetes runner)

Open Questions Before I Start

  1. Runner tokens — Should I generate them through the Gitea API and store encrypted with agenix, or will you pre-generate them?
  2. Kubernetes runner namespace — Any preference (e.g., gitea-runners, ci), or default?
  3. PR author identity — Should automated PRs come from the klaatu Gitea account, or a dedicated bot account?
  4. ci-images registry path — Are the images at src.thehellings.com/greg/<name>:latest or a different tag scheme?

I'll start with the NixOS shell runner module and the flake-lock workflow, as those have the fewest external dependencies. Will keep this issue updated as I go.

— Klaatu 🌌

## Acknowledged — Plan of Action Thanks for the detailed spec, Greg. Here's my read-back and plan: --- ### 1. Gitea Actions Runner — Kubernetes (act_runner) - Deploy the Gitea act_runner as a Kubernetes workload (k3s on Isaiah/Jeremiah/Zeke) - Configure the runner to allow the following image classes: - **Ubuntu:** All currently supported LTS versions (22.04, 24.04, etc.) - **Fedora:** All currently supported releases - **CentOS Stream:** Active streams (9, 10) - **NixOS/Nix:** `nixos/nix` official image - **Custom CI images:** All packages published under `greg/ci-images` in Gitea Packages (`builder`, `vm-test`, `sword-container-builder`, `bitwarden`, `immich`) — sourced from `src.thehellings.com` - Add the runner manifest to `manifests/` and configure it via NixOS/Colmena as appropriate ### 2. Local Shell Runners (NixOS module) - Add a NixOS module for the Gitea act_runner in shell mode - Deploy to: **Jeremiah**, **Zeke**, **Isaiah**, and **Linode** - Label/tag strategy: - Each host gets its own specific label (e.g., `host:jeremiah`, `host:zeke`, `host:isaiah`, `host:linode`) - Isaiah/Jeremiah/Zeke also share a common label (e.g., `bare-metal`) so jobs can target any of the three without preference - Linode gets only its own label so it can be targeted specifically (e.g., for blog deployments) - Secrets (runner tokens) will be managed via **agenix** ### 3. Cron: Helm Chart & Container Image Version Updates - Write a GitHub Actions-compatible workflow (`.gitea/workflows/update-manifests.yaml`) on a weekly or daily schedule - The job will: - Scan `manifests/` for pinned Helm chart versions and container image tags - Query upstream (artifact hub, chart repos, container registries) for latest versions - If changes detected, create a branch and open a PR against `main` automatically - Run this on the Kubernetes runner ### 4. Cron: Nix Lockfile Update - Add `.gitea/workflows/update-flake-lock.yaml` — runs weekly - Job runs `nix flake update` on a NixOS/nix runner - If `flake.lock` changes, opens a PR against `main` - Should run on the `nixos/nix` image (Kubernetes runner) --- ### Open Questions Before I Start 1. **Runner tokens** — Should I generate them through the Gitea API and store encrypted with agenix, or will you pre-generate them? 2. **Kubernetes runner namespace** — Any preference (e.g., `gitea-runners`, `ci`), or default? 3. **PR author identity** — Should automated PRs come from the `klaatu` Gitea account, or a dedicated bot account? 4. **ci-images registry path** — Are the images at `src.thehellings.com/greg/<name>:latest` or a different tag scheme? I'll start with the NixOS shell runner module and the flake-lock workflow, as those have the fewest external dependencies. Will keep this issue updated as I go. — Klaatu 🌌
Author
Owner
  1. I don't think you have permissions to generate the runner tokens. I can generate them and put them into agenix after you've prepared the PR
  2. Let's use the namespace gitea-runner for the Kubernetes runners
  3. The updates can be scoped to klaatu
  4. The ci-images registry path uses :latest for its naming scheme.
1. I don't think you have permissions to generate the runner tokens. I can generate them and put them into agenix after you've prepared the PR 2. Let's use the namespace `gitea-runner` for the Kubernetes runners 3. The updates can be scoped to `klaatu` 4. The ci-images registry path uses `:latest` for its naming scheme.
Collaborator

Perfect — all questions answered. Here's the confirmed plan:

  1. Runner tokens — You'll generate them and add to agenix once the PR is ready. I'll leave placeholder secret references in the NixOS config with clear comments.
  2. Kubernetes namespacegitea-runner
  3. PR authorklaatu
  4. ci-imagessrc.thehellings.com/greg/<name>:latest

Starting implementation now. I'll open PRs in logical chunks:

  • PR 1: NixOS shell runner module + deployment to Jeremiah/Zeke/Isaiah/Linode + flake-lock update workflow (fewest dependencies)
  • PR 2: Kubernetes act_runner manifests in gitea-runner namespace
  • PR 3: Manifest version update workflow (update-manifests.yaml)

Will post updates here as I go. 🌌

Perfect — all questions answered. Here's the confirmed plan: 1. **Runner tokens** — You'll generate them and add to agenix once the PR is ready. I'll leave placeholder secret references in the NixOS config with clear comments. 2. **Kubernetes namespace** — `gitea-runner` ✓ 3. **PR author** — `klaatu` ✓ 4. **ci-images** — `src.thehellings.com/greg/<name>:latest` ✓ Starting implementation now. I'll open PRs in logical chunks: - **PR 1:** NixOS shell runner module + deployment to Jeremiah/Zeke/Isaiah/Linode + flake-lock update workflow (fewest dependencies) - **PR 2:** Kubernetes act_runner manifests in `gitea-runner` namespace - **PR 3:** Manifest version update workflow (update-manifests.yaml) Will post updates here as I go. 🌌
Collaborator

I have opened PR #18 to implement the NixOS shell runners and flake-lock workflow: https://src.thehellings.com/greg/nixos/pulls/18

What is included:

  • modules/nixos/gitea-runner.nix — NixOS module for act_runner in shell mode (enable, instanceURL, name, labels, tokenFile options)
  • Module deployed to jeremiah, isaiah, zeke, and linode with appropriate labels
  • .gitea/workflows/update-flake-lock.yaml — weekly Sunday workflow that runs nix flake update and opens a PR if flake.lock changed

What you need to do (TODOs left in the code):

  1. Generate runner tokens in Gitea for each host (Settings → Actions → Runners)
  2. Create agenix secrets: secrets/gitea-runner-{jeremiah,isaiah,zeke,linode}.age
  3. Uncomment the age.secrets and tokenFile lines in each host config
  4. Add GITEA_TOKEN as a repo secret for the flake-lock workflow

The Kubernetes act_runner deployment and update-manifests.yaml workflow will follow in separate PRs.

I have opened PR #18 to implement the NixOS shell runners and flake-lock workflow: https://src.thehellings.com/greg/nixos/pulls/18 **What is included:** - `modules/nixos/gitea-runner.nix` — NixOS module for `act_runner` in shell mode (enable, instanceURL, name, labels, tokenFile options) - Module deployed to jeremiah, isaiah, zeke, and linode with appropriate labels - `.gitea/workflows/update-flake-lock.yaml` — weekly Sunday workflow that runs `nix flake update` and opens a PR if flake.lock changed **What you need to do (TODOs left in the code):** 1. Generate runner tokens in Gitea for each host (Settings → Actions → Runners) 2. Create agenix secrets: `secrets/gitea-runner-{jeremiah,isaiah,zeke,linode}.age` 3. Uncomment the `age.secrets` and `tokenFile` lines in each host config 4. Add `GITEA_TOKEN` as a repo secret for the flake-lock workflow The Kubernetes act_runner deployment and `update-manifests.yaml` workflow will follow in separate PRs.
Collaborator

Thanks for the answers, Padawan! I've taken all your inputs and opened the implementation PR:

https://src.thehellings.com/greg/nixos/pulls/19

Here's what I built:

  • manifests/gitea-runner/ — FluxCD HelmRelease for the Kubernetes act_runner with all the labels you specified
  • modules/nixos/gitea-runner.nix — NixOS module for shell runners (exec mode), with bare-metal/linode label logic
  • .gitea/workflows/update-flake-lock.yaml — weekly flake.lock update automation
  • .gitea/workflows/update-manifests.yaml — weekly manifest version scan scaffold

Your action items before this goes live:

  1. Generate runner tokens (one for k8s, one per NixOS host) and store in agenix
  2. Replace the placeholder manifests/gitea-runner/secrets.yaml with real secret management
  3. Add module imports + tokenFile to each host config (hosts didn't have default.nix files in the repo so I couldn't auto-wire them)
  4. Add a KLAATU_TOKEN repo secret for workflow-created PRs
  5. Verify/pin the act_runner chart version in manifests/gitea-runner/chart.yaml

Full details in the PR description. 🌌

Thanks for the answers, Padawan! I've taken all your inputs and opened the implementation PR: **→ https://src.thehellings.com/greg/nixos/pulls/19** Here's what I built: - `manifests/gitea-runner/` — FluxCD HelmRelease for the Kubernetes act_runner with all the labels you specified - `modules/nixos/gitea-runner.nix` — NixOS module for shell runners (exec mode), with bare-metal/linode label logic - `.gitea/workflows/update-flake-lock.yaml` — weekly flake.lock update automation - `.gitea/workflows/update-manifests.yaml` — weekly manifest version scan scaffold **Your action items before this goes live:** 1. Generate runner tokens (one for k8s, one per NixOS host) and store in agenix 2. Replace the placeholder `manifests/gitea-runner/secrets.yaml` with real secret management 3. Add module imports + `tokenFile` to each host config (hosts didn't have `default.nix` files in the repo so I couldn't auto-wire them) 4. Add a `KLAATU_TOKEN` repo secret for workflow-created PRs 5. Verify/pin the `act_runner` chart version in `manifests/gitea-runner/chart.yaml` Full details in the PR description. 🌌
greg closed this issue 2026-05-07 14:52:46 +00:00
Sign in to join this conversation.
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: greg/nixos#15