Skip to content

Commit

Permalink
Merge pull request #5 from rake5k/docker-images
Browse files Browse the repository at this point in the history
Add Docker image removal option
  • Loading branch information
jlumbroso committed Jun 28, 2023
2 parents 76866db + 0add001 commit 4d9e71b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
```
## Options
Expand All @@ -49,6 +50,7 @@ Here are a few sources of inspiration:
- https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
- https://github.com/ShubhamTatvamasi/free-disk-space-action
- https://github.com/actions/virtual-environments/issues/2875#issuecomment-1163392159
- https://github.com/easimon/maximize-build-space/

## Typical Output

Expand Down Expand Up @@ -1638,4 +1640,4 @@ overall:
********************************************************************************
=> Saved 31GiB
********************************************************************************
```
```
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ inputs:
required: false
default: "true"

docker-images:
description: "Remove Docker images"
required: false
default: "true"

# option inspired by:
# https://github.com/actions/virtual-environments/issues/2875#issuecomment-1163392159
tool-cache:
Expand Down Expand Up @@ -180,6 +185,18 @@ runs:
printSavedSpace $SAVED "Large misc. packages"
fi
# Option: Remove Docker images
if [[ ${{ inputs.docker-images }} == 'true' ]]; then
BEFORE=$(getAvailableSpace)
sudo docker image prune --all --force
AFTER=$(getAvailableSpace)
SAVED=$((AFTER-BEFORE))
printSavedSpace $SAVED "Docker images"
fi
# Option: Remove tool cache
# REF: https://github.com/actions/virtual-environments/issues/2875#issuecomment-1163392159
Expand Down

0 comments on commit 4d9e71b

Please sign in to comment.