]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CI: clean up docker cruft after job runs
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sun, 23 Oct 2022 17:27:06 +0000 (18:27 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sun, 23 Oct 2022 17:45:48 +0000 (18:45 +0100)
.github/workflows/ci.yml

index c5d398a4697f2de6aaf03ba5d637d86f28b79d2b..50929a4bda0e36dd6d482df221c3c10ea5877da0 100644 (file)
@@ -318,3 +318,21 @@ jobs:
           USERNAME: ${{ github.repository_owner }}
           REPO_NAME: ${{ github.repository }}
           REPO_KEY: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
+
+  post-ci:
+    runs-on: self-hosted
+    name: "Post-job cleanup"
+    needs:
+      - ci
+    steps:
+      - id: cleanup_containers
+        name: "Cleanup docker containers"
+        run: /usr/bin/docker container prune -f || true
+
+      - id: cleanup_volumes
+        name: "Cleanup docker volumes"
+        run: /usr/bin/docker volume prune -f || true
+
+      - id: cleanup_images
+        name: "Cleanup docker images"
+        run: /usr/bin/docker image prune -f || true