Skip to content

Commit

Permalink
Add logic to deallocate VM
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisameling committed Dec 20, 2022
1 parent 515ad82 commit 4c590d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/create-azure-vm-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,10 @@ jobs:
resourceGroupName: ${{ secrets.AZURE_RESOURCE_GROUP }}
template: ./azure-arm-template.json
parameters: ./azure-arm-template-example-parameters.json githubActionsRunnerRegistrationUrl="${{ env.ACTIONS_RUNNER_REGISTRATION_URL }}" githubActionsRunnerToken="${{ env.ACTIONS_RUNNER_TOKEN }}" postDeploymentPsScriptUrl="${{ env.POST_DEPLOYMENT_SCRIPT_URL }}" virtualMachineName=${{ steps.generate-vm-name.outputs.vm_name }} virtualMachineSize=Standard_D8pls_v5 publicIpAddressName1=${{ steps.generate-vm-name.outputs.vm_name }}-ip adminUsername=${{ secrets.AZURE_VM_USERNAME }} adminPassword=${{ secrets.AZURE_VM_PASSWORD }}

- name: Deallocate the VM for later use
uses: azure/CLI@v1
with:
azcliversion: 2.43.0
inlineScript: |
az vm deallocate -n ${{ steps.generate-vm-name.outputs.vm_name }} -g ${{ secrets.AZURE_RESOURCE_GROUP }} --verbose

0 comments on commit 4c590d0

Please sign in to comment.