🗑️(CI) free up space in the GitHub Actions runners
On the release pull request workflows, we sometimes face issues with disk space. We clean up some space before starting Docker services or after finishing to build images to avoid these issues.
This commit is contained in:
24
.github/actions/free-disk-space/action.yml
vendored
Normal file
24
.github/actions/free-disk-space/action.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: 'Free Disk Space'
|
||||
description: 'Free up disk space by removing large preinstalled items and cleaning up Docker'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Free disk space (Linux only)
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Disk usage before cleanup:"
|
||||
df -h
|
||||
|
||||
# Remove large preinstalled items that are not used on GitHub-hosted runners
|
||||
sudo rm -rf /usr/share/dotnet || true
|
||||
sudo rm -rf /opt/ghc || true
|
||||
sudo rm -rf /usr/local/lib/android || true
|
||||
|
||||
# Clean up Docker
|
||||
docker system prune -af || true
|
||||
docker volume prune -f || true
|
||||
|
||||
echo "Disk usage after cleanup:"
|
||||
df -h
|
||||
Reference in New Issue
Block a user