Files
actions/cleanup-disk/action.yml
T
2026-03-17 22:16:40 +01:00

29 lines
875 B
YAML

# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
name: "Disk Space Cleanup"
author: "Ultralytics"
description: "Cleans up disk space by removing unnecessary tool caches and swap space"
runs:
using: "composite"
steps:
- name: Cleanup disk space
shell: bash
run: |
echo "::group::Disk Space Before Cleanup"
df -h /
echo "::endgroup::"
echo "::group::Remove Tool Cache and Swap"
# 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 "::endgroup::"
echo "::group::Disk Space After Cleanup"
df -h /
echo "::endgroup::"