fix(cd): avoid deploying stale images and add cleanup policy

This commit is contained in:
2026-03-16 04:56:42 +04:00
parent b71480e9f1
commit c5c0b32f20
2 changed files with 57 additions and 3 deletions

View File

@@ -19,6 +19,22 @@ resource "google_artifact_registry_repository" "containers" {
labels = local.common_labels
cleanup_policies {
id = "keep-last-10"
action = "KEEP"
most_recent_versions {
keep_count = 10
}
}
cleanup_policies {
id = "delete-stale"
action = "DELETE"
condition {
older_than = "1209600s" # 14 days
}
}
lifecycle {
ignore_changes = [
labels,