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 /