Cleanup Docker #6
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: Cleanup Docker | |
on: | |
schedule: | |
- cron: '0 1 * * 0' # Every sunday at 1 in the morning | |
workflow_dispatch: {} | |
# The following job exists as three separate copies scheduled in parallel, | |
# because this will let the three instances of the job be executed on all three | |
# runners, otherwise some runners would never see a cleanup | |
jobs: | |
dockergc1: | |
runs-on: self-hosted | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Context | |
run: | | |
docker context create builder | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
endpoint: builder | |
- name: Docker Prune | |
run: | | |
docker builder prune --force | |
docker system prune -a --volumes --force | |
dockergc2: | |
runs-on: self-hosted | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Context | |
run: | | |
docker context create builder | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
endpoint: builder | |
- name: Docker Prune | |
run: | | |
docker builder prune --force | |
docker system prune -a --volumes --force | |
dockergc3: | |
runs-on: self-hosted | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Context | |
run: | | |
docker context create builder | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
endpoint: builder | |
- name: Docker Prune | |
run: | | |
docker builder prune --force | |
docker system prune -a --volumes --force |