ci: scope image prune to drsousan only, never touch other projects
CI/CD / CI · dotnet build (push) Successful in 23s
CI/CD / Deploy · drsousan (push) Successful in 12s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-05-31 23:37:06 +03:30
parent 14f902cdad
commit 8fa3131344
+9 -3
View File
@@ -56,7 +56,7 @@ jobs:
working-directory: DrSousan.Api
run: dotnet build DrSousan.Api.csproj --no-restore -c Release
# ── CD: build image → push to Nexus → deploy (push to main only) ────────────
# ── CD: build image → deploy locally (push to main only) ───────────────────
deploy:
name: "Deploy · drsousan"
runs-on: self-hosted
@@ -109,6 +109,12 @@ jobs:
if: always()
run: docker compose ps
- name: Prune old images
- name: Prune old drsousan images
if: success()
run: docker image prune -f
# Only remove untagged (dangling) drsousan images — never touches other projects
run: |
docker images --format '{{.Repository}}:{{.Tag}} {{.ID}}' \
| grep '^mirror\.soroushasadi\.com/drsousan/' \
| grep '<none>' \
| awk '{print $2}' \
| xargs -r docker rmi || true