Files
infrastructure/.gitea/workflows/cleanup-nixos.yml
Alex Mickelson 758e0fb3ba
All checks were successful
Apply Kuberentes Configs / update-repo (push) Successful in 1s
Apply Kuberentes Configs / update-infrastructure (push) Successful in 3s
Apply Kuberentes Configs / notify-on-failure (push) Has been skipped
Cleanup NixOS Generations / cleanup-generations (push) Successful in 2s
Cleanup NixOS Generations / notify-on-failure (push) Has been skipped
Cleanup Docker / cleanup-docker (push) Successful in 1s
Cleanup Docker / notify-on-failure (push) Has been skipped
ZFS Backup / notify-on-failure (push) Has been skipped
ZFS Backup / update-infrastructure (push) Successful in 1m43s
Libation / update-repo (push) Successful in 0s
Libation / sync-audiobooks (push) Successful in 5s
Libation / notify-on-failure (push) Has been skipped
Manage Jellyfin Playlists / update-repo (push) Successful in 1s
Manage Jellyfin Playlists / run-python (push) Successful in 52s
Manage Jellyfin Playlists / notify-on-failure (push) Has been skipped
cleanup docker
2026-02-18 21:11:55 -07:00

30 lines
843 B
YAML

name: Cleanup NixOS Generations
on:
schedule:
- cron: '0 2 * * 0' # Every Sunday at 2am
workflow_dispatch:
jobs:
cleanup-generations:
runs-on: [home-server]
steps:
- name: Cleanup old NixOS generations
run: |
echo "Deleting generations older than 7 days..."
sudo nix-collect-garbage --delete-older-than 7d
notify-on-failure:
runs-on: home-server
needs: cleanup-generations
if: failure()
uses: ./.gitea/workflows/notify-ntfy.yml
secrets:
NTFY_CHANNEL: ${{ secrets.NTFY_CHANNEL }}
with:
title: "NixOS Cleanup Failed"
message: |
Failed to cleanup old NixOS generations
action_url: "https://git.alexmickelson.guru/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}"
priority: "high"
tags: "rotating_light,nixos"