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