name: Cleanup Docker on: schedule: - cron: '0 3 1,15 * *' # 1st and 15th of every month at 3am workflow_dispatch: jobs: cleanup-docker: runs-on: [home-server] steps: - name: Cleanup Docker resources run: | echo "" echo "Removing unused images..." docker image prune -a -f --filter "until=336h" notify-on-failure: runs-on: home-server needs: cleanup-docker if: failure() uses: ./.gitea/workflows/notify-ntfy.yml secrets: NTFY_CHANNEL: ${{ secrets.NTFY_CHANNEL }} with: title: "Docker Cleanup Failed" message: | Failed to cleanup Docker resources action_url: "https://git.alexmickelson.guru/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}" priority: "high" tags: "rotating_light,docker"