Skip to content

Commit

Permalink
Cleaning space strategies to push to Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Dec 27, 2024
1 parent b542c1a commit e9bcfad
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Disk space before
run: df . -h
- name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf /usr/share/dotnet/ /usr/local/graalvm/ /usr/local/.ghcup/ \
/usr/local/share/powershell /usr/local/share/chromium /usr/local/share/boost \
/usr/local/lib/android /usr/local/lib/node_modules /opt/hostedtoolcache/CodeQL \
/opt/ghc /usr/local/.ghcup || true
echo "some directories deleted"
sudo apt-get remove --purge -y google-chrome-stable >/dev/null 2>&1 || true
sudo apt-get remove --purge -y microsoft-edge-stable >/dev/null 2>&1 || true
sudo apt-get remove --purge -y firefox >/dev/null 2>&1 || true
sudo apt-get remove --purge -y '^dotnet-.*' >/dev/null 2>&1 || true
sudo apt-get remove --purge -y '^llvm-.*' >/dev/null 2>&1 || true
sudo apt-get remove --purge -y 'php.*' >/dev/null 2>&1 || true
sudo apt-get remove --purge -y '^mongodb-.*' >/dev/null 2>&1 || true
sudo apt-get remove --purge -y '^mysql-.*' >/dev/null 2>&1 || true
sudo apt-get remove --purge -y '^postgresql-.*' >/dev/null 2>&1 || true
sudo apt-get remove --purge -y temurin-* >/dev/null 2>&1 || true
sudo apt-get remove --purge -y azure-cli google-cloud-cli* powershell >/dev/null 2>&1 || true
sudo apt-get autoremove -y
sudo apt-get autoclean -y
echo "some packages purged"
- name: Disk space after
run: df . -h
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java JDK
Expand Down

0 comments on commit e9bcfad

Please sign in to comment.