From 259ce75bd69a7cd5bd76625fbe9107d0a7c5192a Mon Sep 17 00:00:00 2001 From: Richard Case Date: Fri, 20 Oct 2023 14:37:34 +0200 Subject: [PATCH] chore: add azure janitor in dry-run Signed-off-by: Richard Case --- .github/workflows/e2e-long.yaml | 10 ++++++++++ .github/workflows/janitor.yaml | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/janitor.yaml diff --git a/.github/workflows/e2e-long.yaml b/.github/workflows/e2e-long.yaml index f31b9606..8c38eda1 100644 --- a/.github/workflows/e2e-long.yaml +++ b/.github/workflows/e2e-long.yaml @@ -39,6 +39,16 @@ jobs: with: name: artifacts path: _artifacts + - name: Cleanup Azure Resources + if: always() + uses: rancher-sandbox/azure-janitor@v0.1.1 + with: + resource-groups: highlander-e2e* + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID}} + client-id: ${{ secrets.AZURE_CLIENT_ID}} + client-secret: ${{ secrets.AZURE_CLIENT_SECRET}} + tenant-id: ${{ secrets.AZURE_TENANT_ID}} + commit: false - name: Send failed status to slack if: failure() uses: slackapi/slack-github-action@v1.24.0 diff --git a/.github/workflows/janitor.yaml b/.github/workflows/janitor.yaml new file mode 100644 index 00000000..0d277ef1 --- /dev/null +++ b/.github/workflows/janitor.yaml @@ -0,0 +1,21 @@ +name: Janitor + +on: + schedule: + - cron: "0 3 * * *" + workflow_dispatch: + +jobs: + janitor: + name: azure-janitor + runs-on: ubuntu-latest + steps: + - name: Cleanup + uses: rancher-sandbox/azure-janitor@v0.1.1 + with: + resource-groups: highlander-e2e* + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID}} + client-id: ${{ secrets.AZURE_CLIENT_ID}} + client-secret: ${{ secrets.AZURE_CLIENT_SECRET}} + tenant-id: ${{ secrets.AZURE_TENANT_ID}} + commit: false \ No newline at end of file