From 8b83c1a341795bf02febbdb6a3e6f243fdc730ac Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Mon, 28 Oct 2024 18:37:19 +0000 Subject: [PATCH] cleaner cleanup --- .github/workflows/docker.yaml | 20 +------------------- docker/gh-cleanup.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 19 deletions(-) create mode 100755 docker/gh-cleanup.sh diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 8e611d7..f22f611 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -22,25 +22,7 @@ jobs: with: submodules: true - - run: df -h / - - run: | - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo rm -rf /opt/hostedtoolcache - sudo rm -rf /opt/google/chrome - sudo rm -rf /opt/microsoft/msedge - sudo rm -rf /opt/microsoft/powershell - sudo rm -rf /opt/pipx - sudo rm -rf /usr/lib/mono - sudo rm -rf /usr/local/julia* - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/local/lib/node_modules - sudo rm -rf /usr/local/share/chromium - sudo rm -rf /usr/local/share/powershell - sudo rm -rf /usr/share/dotnet - sudo rm -rf /usr/share/swift - - run: df -h / - - run: sleep 10 - - run: df -h / + - run: ./docker/gh-cleanup.sh - run: ./docker/build.sh diff --git a/docker/gh-cleanup.sh b/docker/gh-cleanup.sh new file mode 100755 index 0000000..0da84ad --- /dev/null +++ b/docker/gh-cleanup.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +echo Initial +df -h / +df / + +FOLDERS=" + $AGENT_TOOLSDIRECTORY + /opt/hostedtoolcache + /opt/google/chrome + /opt/microsoft/msedge + /opt/microsoft/powershell + /opt/pipx + /usr/lib/mono + /usr/local/julia* + /usr/local/lib/android + /usr/local/lib/node_modules + /usr/local/share/chromium + /usr/local/share/powershell + /usr/share/dotnet + /usr/share/swift +" + +for folder in $FOLDERS ; do + echo "Cleaning up $folder" + rm -rf $folder + df / +done + +echo "Final" +df -h /