Skip to content

Commit

Permalink
Merge pull request #3581 from k0sproject/backport-3580-to-release-1.26
Browse files Browse the repository at this point in the history
[Backport release-1.26] Reclaim GitHub Runner disk space
  • Loading branch information
twz123 authored Oct 23, 2023
2 parents b27a0ac + 3e9e1d2 commit f565966
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Reclaim runner disk space
run: .github/workflows/reclaim-runner-disk-space.bash

- name: Prepare build environment
run: .github/workflows/prepare-build-env.sh

Expand Down Expand Up @@ -290,6 +293,9 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Reclaim runner disk space
run: .github/workflows/reclaim-runner-disk-space.bash

- name: Prepare build environment
run: .github/workflows/prepare-build-env.sh

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/reclaim-runner-disk-space.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set +eux

if [ -z "$GITHUB_RUN_ID" ]; then
echo "Cowardly refusing to destroy a machine that doesn't look like a GitHub runner." >&2
exit 0
fi

df -h /

docker system prune --all --force &
sudo rm -rf /imagegeneration/installers &
sudo rm -rf -- "${ANDROID_SDK_ROOT-/opt/nevermind}" &

wait

df -h /

0 comments on commit f565966

Please sign in to comment.