Skip to content

AzPSImageInfraDeploymentWithApproval #4

AzPSImageInfraDeploymentWithApproval

AzPSImageInfraDeploymentWithApproval #4

name: AzPSImageInfraDeploymentWithApproval
on: [workflow_dispatch]
jobs:
GovernanceResourcesJob:
runs-on: ubuntu-latest
container: mcr.microsoft.com/azure-powershell:latest #Execution in the container is quicker than azure/powershell@v2
steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: 3TierApp/
- name: Deploy Governance resources
shell: pwsh
run: |
. ./3TierApp/HelperFunctions.ps1
Connect-MySubscription ${{ vars.MULLICKTENANTID }} ${{ vars.FTESUBID }} ${{ vars.PSGHACTIONSCLIENTID }} ${{ secrets.PSGHACTIONSSECRET }}
./3TierApp/GovResource.ps1
$RG = Get-AzResourceGroup -Name GitHubAction24 -Verbose
$rgName = $RG.ResourceGroupName
Write-Output "rg_name=$rgName" >> $Env:GITHUB_OUTPUT
DeployVirtualMachines:
needs: GovernanceResourcesJob
runs-on: ubuntu-latest
container: mcr.microsoft.com/azure-powershell:latest
environment:
name: VMEnvironment # This environment has manual approval configured
steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: 3TierApp/
- name: Deploy Virtual machines
shell: pwsh
run: |
. ./3TierApp/HelperFunctions.ps1
Connect-MySubscription ${{ vars.MULLICKTENANTID }} ${{ vars.FTESUBID }} ${{ vars.PSGHACTIONSCLIENTID }} ${{ secrets.PSGHACTIONSSECRET }}
./GHActionTest/GetRG.ps1
$rgName = "${{ needs.set_resource_group.outputs.rg_name }}"
Write-Host "Using Resource Group Name: $rgName"