ci: add GC roots to prevent cached packages from being collected
All checks were successful
CI / check (push) Successful in 4m0s
CI / build-and-cache (custom-app-launcher-server) (push) Successful in 2m28s
CI / build-and-cache (custom-claude-code) (push) Successful in 2m27s
CI / build-and-cache (custom-mcrcon-rbw) (push) Successful in 2m18s
CI / build-and-cache (custom-rclone-torbox-setup) (push) Successful in 2m23s
CI / build-and-cache (custom-tea-rbw) (push) Successful in 3m32s
CI / build-and-cache (qt-pinned-jellyfin-media-player) (push) Successful in 3m42s

Creates symlinks in /nix/var/nix/gcroots/ci-cache/ for each pushed package
This commit is contained in:
mayor
2026-02-12 21:14:20 -08:00
committed by John Ogle
parent d799bd2d32
commit f3fa5fcf13

View File

@@ -63,5 +63,10 @@ jobs:
# Push to cache
nix copy --to "ssh-ng://${{ secrets.CACHE_USER }}@${{ secrets.CACHE_HOST }}?ssh-key=$HOME/.ssh/cache_key" "${{ steps.build.outputs.out_path }}"
# Create GC root to prevent garbage collection
OUT_HASH=$(basename "${{ steps.build.outputs.out_path }}" | cut -d'-' -f1)
ssh -i ~/.ssh/cache_key ${{ secrets.CACHE_USER }}@${{ secrets.CACHE_HOST }} \
"mkdir -p /nix/var/nix/gcroots/ci-cache && ln -sfn ${{ steps.build.outputs.out_path }} /nix/var/nix/gcroots/ci-cache/${OUT_HASH}"
env:
NIX_CONFIG: "access-tokens = git.johnogle.info=${{ secrets.GITEA_ACCESS_TOKEN }}"