Skip to content

Clear cache

Clear cache #373

Workflow file for this run

---
# yamllint disable rule:line-length
name: Clear cache
on:
schedule:
- cron: '30 1 * * 1-5'
workflow_dispatch:
jobs:
job1:
name: Clear Docker
if: always()
runs-on: ${{ matrix.runner_label }}
strategy:
matrix:
runner_label: ${{ fromJSON('["lionco-runner-1", "lionco-runner-2", "lionco-runner-3", "lionco-runner-4", "lionco-runner-5", "lionco-runner-6", "lionco-runner-7", "lionco-runner-8", "lionco-runner-9", "lionco-runner-10"]') }}
steps:
- name: Stop old containers
run: docker ps -q | grep -q . && docker stop $(docker ps -q) -t0 || echo "No containers to stop"
- name: Remove old containers
run: docker ps -a -q | grep -q . && docker rm $(docker ps -a -q) || echo "No containers to remove"
- name: Remove all volumes
run: docker volume ls -q | grep -q . && docker volume rm $(docker volume ls -q) || echo "No volumes to remove"
- name: Delete old images
run: docker system prune --volumes --all --force
job2:
name: Clear workspaces
if: always()
needs: job1
runs-on: ${{ matrix.runner_label }}
strategy:
matrix:
runner_label: ${{ fromJSON('["lionco-runner-1", "lionco-runner-2", "lionco-runner-3", "lionco-runner-4", "lionco-runner-5", "lionco-runner-6", "lionco-runner-7", "lionco-runner-8", "lionco-runner-9", "lionco-runner-10"]') }}
steps:
- name: Clean Workspace
if: always()
uses: AutoModality/[email protected]
- uses: xembly/workflow-manager@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
run: clean
verbose: true