-
Notifications
You must be signed in to change notification settings - Fork 469
36 lines (29 loc) · 958 Bytes
/
cleanup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: CleanUp Resources
on:
push:
branches:
- PSL-Automation-Flow-Draft
workflow_dispatch:
jobs:
az_cleanup:
if: ${{ vars.RUN_AZCLEANUP == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az --version # Verify installation
- name: Login to Azure
run: |
az login --service-principal -u ${{ secrets.AUTO_AZURE_CLIENT_ID }} -p ${{ secrets.AUTO_AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AUTO_AZURE_TENANT_ID }}
az account set --subscription ${{ secrets.AUTO_AZURE_SUBSCRIPTION_ID }}
- name: Install Bicep CLI
run: az bicep install
- name: Delete Bicep Deployment
run: |
az group delete \
--name PSLResourceGroupDraft \
--yes \
--no-wait