mirror of
https://codeberg.org/tmayoff/.dotfiles.git
synced 2025-12-06 08:48:34 -05:00
44 lines
1 KiB
YAML
44 lines
1 KiB
YAML
name: "Clear disk space"
|
|
description: "Frees disk space in the GHA runner"
|
|
inputs:
|
|
debug:
|
|
description: Enabling this will print before and after disk sizes
|
|
default: false
|
|
required: false
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Get disk usage
|
|
shell: bash
|
|
run: |
|
|
# df -h | head -n 1 | cut -d ' ' -f 3,5
|
|
# df -h | grep /\$ | cut -d ' ' -f 3,5
|
|
df -h
|
|
|
|
- name: Detailed usage
|
|
if: inputs.debug
|
|
shell: bash
|
|
run: |
|
|
du -h -d3 / 2>/dev/null | sort -hr | head -n 20 || true
|
|
|
|
- name: Clear
|
|
shell: bash
|
|
run: |
|
|
./clean.sh
|
|
sudo docker system prune -af || true
|
|
sudo docker image prune -af || true
|
|
sudo docker builder prune -af || true
|
|
|
|
- name: Get disk usage
|
|
shell: bash
|
|
run: |
|
|
echo "used use%"
|
|
# df -h | grep /\$ | cut -d ' ' -f 5,9
|
|
df -h
|
|
|
|
- name: Detailed usage
|
|
if: inputs.debug
|
|
shell: bash
|
|
run: |
|
|
du -h -d3 / 2>/dev/null | sort -hr | head -n 20 || true
|