From b074cd17df581ed1f2ea85b4f0508eaf4485ec15 Mon Sep 17 00:00:00 2001 From: Naomi Roberts Date: Thu, 14 May 2026 20:42:20 +0100 Subject: [PATCH] Notify when docs site updated Signed-off-by: Naomi Roberts --- hosts/seer/services/mc-docs.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hosts/seer/services/mc-docs.nix b/hosts/seer/services/mc-docs.nix index 2d9eacb..8c619cf 100644 --- a/hosts/seer/services/mc-docs.nix +++ b/hosts/seer/services/mc-docs.nix @@ -5,7 +5,10 @@ in { systemd.services."mc-docs" = { description = "https://${url} source"; - serviceConfig.Type = "oneshot"; + serviceConfig = { + Type = "oneshot"; + EnvironmentFile = "/var/secrets/mc-docs.env"; + }; startAt = "*:0/5"; path = with pkgs; [nix git]; script = '' @@ -18,6 +21,13 @@ in { mkdir -p /var/www/ ln -sfT $result/var/www/docs ${out} + + commit=$(git rev-parse --short HEAD) + + if [ "$(cat current)" != "$commit" ]; then + echo $commit > current + nix run .#kivia -- "Docs Site Deployed" "Updated docs and resource pack" "https://${url}" "Commit: $commit" "57e389" + fi ''; }; -- 2.51.2