diff --git a/.github/actions/disk-cleanup/action.yml b/.github/actions/disk-cleanup/action.yml new file mode 100644 index 0000000..deb112f --- /dev/null +++ b/.github/actions/disk-cleanup/action.yml @@ -0,0 +1,28 @@ +name: Disk cleanup +description: "Cleanup disk space" +runs: + using: composite + steps: + - name: Free up disk space + shell: bash + run: | + echo "Disk space before cleanup..." + df -h / + echo "Removing unnecessary files to free up disk space..." + # https://github.com/actions/runner-images/issues/2840#issuecomment-2272410832 + sudo rm -rf \ + /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 + echo "Disk space after cleanup..." + df -h / diff --git a/.github/workflows/publish-arch-container.yml b/.github/workflows/publish-arch-container.yml index 0a213de..2bdf244 100644 --- a/.github/workflows/publish-arch-container.yml +++ b/.github/workflows/publish-arch-container.yml @@ -27,6 +27,10 @@ jobs: id-token: write steps: + # https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930 + - name: Free disk space + uses: ./.github/actions/disk-cleanup + - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/publish-debian-container.yml b/.github/workflows/publish-debian-container.yml index d4117ab..a5d60b6 100644 --- a/.github/workflows/publish-debian-container.yml +++ b/.github/workflows/publish-debian-container.yml @@ -27,6 +27,10 @@ jobs: id-token: write steps: + # https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930 + - name: Free disk space + uses: ./.github/actions/disk-cleanup + - name: Checkout repository uses: actions/checkout@v4