From c6fd7aa96d5e4f7fc7d5b6c34f1f2b02e8fc130b Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 9 Sep 2022 06:24:24 +1000 Subject: [PATCH] Delete images older than 2 days, check every day (#5113) --- .github/workflows/delete-gcp-resources.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/delete-gcp-resources.yml b/.github/workflows/delete-gcp-resources.yml index 2693bac1..fb44bf0b 100644 --- a/.github/workflows/delete-gcp-resources.yml +++ b/.github/workflows/delete-gcp-resources.yml @@ -1,18 +1,19 @@ name: Delete GCP resources on: - # Run right before Teor's week starts (0500 in UTC+10) + # Run daily, when most devs aren't working + # 0700 UTC is after AEST working hours but before ET working hours schedule: - - cron: "0 19 * * 0" + - cron: "0 7 * * *" workflow_dispatch: env: # Delete all resources created before $DELETE_AGE_DAYS days ago. - DELETE_AGE_DAYS: 7 + # We keep this short to reduce storage costs. + DELETE_AGE_DAYS: 2 # But keep the latest $KEEP_LATEST_IMAGE_COUNT images of each type. - # - # TODO: reduce this to 1 or 2 after "The resource is not ready" errors get fixed? - KEEP_LATEST_IMAGE_COUNT: 3 + # We keep this small to reduce storage costs. + KEEP_LATEST_IMAGE_COUNT: 2 jobs: delete-resources: