ci: trigger freun-dev deploy on merge #11
Loading…
Reference in a new issue
No description provided.
Delete branch "ci-deploy-trigger"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On-merge deploy for freun-dev (least-privilege trigger design):
.forgejo/workflows/deploy.yml— runs on push to main, ssh's to freun-dev asci-deploy, whose authorized_keys entry is pinned to exactly one command:systemctl start nixos-upgrade.service(+ no forwarding/no-PTY). CI can only trigger the existing pull-based upgrade — no arbitrary commands, no root.modules/ci-deploy.nix— the restricted user (system user, /var/empty home).modules/ssh-values.nix—ci-deploypublic key registered..sops.yaml— creation rule forsecrets/ci-deploy-key(yubikey pgp + freun-dev age only: the key is only needed on freun-dev).Operator steps after merge:
sops secrets/ci-deploy-key— encrypt the plaintext private key (staged on the agent at.hermes/secrets/ci-deploy-key-plain; it never goes into the repo)apply freun-devonce — installs the ci-deploy user + authorized_keysCI_DEPLOY_KEYrepository secret (Settings → Actions → Secrets)Deploy flow after setup: merge → check.yml validates → deploy.yml triggers the upgrade → the unit fetches main (deploy key) and switches; kuma heartbeats report success/failure as today.
Eval-verified; authorized_keys content inspected (command pinned, pubkey matches).
Root cause of the failed check (run #177): the pushed commit predated the
users.users.ci-deploy.groupfix — the eval assertionusers.users.ci-deploy.group is unsetfired in CI exactly as it did locally before the fix.Fixed in c50c981 (
group = "ci-deploy"+users.groups.ci-deploy = { }) — verified: run #184 on this branch = success ✓ (one duplicate run #185 got killed mid-eval by a runner restart — infra hiccup, not an eval error; local eval of the same tree passes: toplevel drv builds, group attrset resolves).Also retriggered via empty commit; run #190 build ✓, paired check running.
@ -66,0 +69,4 @@pkgs.forgejo-clipkgs.rbwpkgs.jq];why did this creep in here?
@ -14,1 +14,4 @@age: [ *apu, *freun-dev, *radish, *turny, *pumpkin ]- path_regex: secrets/ci-deploy-key$pgp: [ *yubikey ]age: [ *freun-dev ]not necessary here, is it? there's no such secret and it lives in the vault and forgejo secrets
Good catch — dropped the
secrets/ci-deploy-keycreation rule in 372a91e: the private key lives in Forgejo secrets (and the vault), the module only consumes the public key fromssh-values.nix, so there's no sops-managed file at all. Also filed review #4 the same way last round (unrelated extraPackages hunk removed in 55745bb). Check run for the new head is queued.372a91e05375116b3d7175116b3d715bf950860f