-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afd7418
commit 6022b70
Showing
1 changed file
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,36 @@ jobs: | |
with: | ||
creds: ${{ secrets.VM_INT_AZURE_CREDENTIALS }} | ||
|
||
- name: Print current directory | ||
run: echo $PWD && ls -al | ||
|
||
- name: Cleanup VM and Resources | ||
uses: azure/[email protected] | ||
with: | ||
inlineScript: | | ||
# Delete the VM first | ||
az vm delete \ | ||
--resource-group integration-test-vm \ | ||
--name ${{ github.event.inputs.vm_name }} \ | ||
--yes | ||
# Delete the NIC | ||
az network nic delete \ | ||
--resource-group integration-test-vm \ | ||
--name ${{ github.event.inputs.vm_name }}-nic | ||
# Delete the Public IP | ||
az network public-ip delete \ | ||
--resource-group integration-test-vm \ | ||
--name ${{ github.event.inputs.vm_name }}-ip | ||
# Delete the NSG | ||
az network nsg delete \ | ||
--resource-group integration-test-vm \ | ||
--name ${{ github.event.inputs.vm_name }}-nsg | ||
# Delete the VNet | ||
az network vnet delete \ | ||
--resource-group integration-test-vm \ | ||
--name ${{ github.event.inputs.vm_name }}-vnet | ||
- name: Create VM with NSG | ||
id: create_vm | ||
uses: azure/arm-deploy@v2 | ||
|