Update cleanup-disk action to remove swap space (#397)

Signed-off-by: Glenn Jocher <[email protected]>
Co-authored-by: UltralyticsAssistant <[email protected]>
This commit is contained in:
Glenn Jocher
2025-03-23 19:36:24 +01:00
committed by GitHub
co-authored by UltralyticsAssistant
parent afcea31ec8
commit 3a28678086
+9 -1
View File
@@ -2,7 +2,7 @@
name: "Disk Space Cleanup"
author: "Ultralytics"
description: "Cleans up disk space by removing unnecessary tool caches and packages"
description: "Cleans up disk space by removing unnecessary tool caches and swap space"
runs:
using: "composite"
steps:
@@ -11,7 +11,15 @@ runs:
run: |
echo "Free space before deletion:"
df -h /
# Remove tool cache to free up ~15GB of space per https://github.com/ultralytics/ultralytics/pull/15848
rm -rf /opt/hostedtoolcache || true
# Remove swap space to free up ~4GB
if [ -f /swapfile ]; then
sudo swapoff -a
sudo rm -f /swapfile
fi
echo "Free space after deletion:"
df -h /