ci: Add scheduled job to cleanup resources

This is the first part of adding a job to clean up potentially dangling
Azure resources. This will be based on Jeremi's tool from
https://github.com/jepio/kata-azure-automation.

At first, we'll only clean up AKS clusters, as this is what has been
causing us problems lately, but this could very well be extended to
cleaning up entire resource groups, which is why I left the different
names pretty generic (i.e. "resources" instead of "clusters").

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
This commit is contained in:
Aurélien Bombo 2024-06-24 21:34:57 +00:00
parent b0cdf4eb0d
commit d60b548d61
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
name: Cleanup dangling Azure resources
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
cleanup-resources:
runs-on: ubuntu-latest
secrets: inherit
steps:
- name: Cleanup resources
run: python3 tests/cleanup_resources.py

View File