Docker clean #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker clean | |
on: | |
schedule: | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
inputs: | |
environment: | |
type: choice | |
description: "Environment" | |
options: | |
- dev | |
default: "dev" | |
jobs: | |
build-on-ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- name: docker ps -a | |
run: docker ps -a | |
- name: Build the Docker image | |
run: docker images | |
- name: Check disk space | |
run: df . -h | |
- name: Free disk space | |
run: | | |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true | |
sudo docker system prune --all | |
sudo rm -rf \ | |
/opt/ghc \ | |
/usr/local/.ghcup \ | |
/usr/lib/jvm || true | |
- name: Check disk space | |
run: df . -h |