ci: Update build.yml

This commit is contained in:
Nicolas Giard 2024-10-18 00:04:37 -04:00 committed by GitHub
parent 400bbca958
commit ebc7cde351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -258,7 +258,7 @@ jobs:
curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh sudo bash nodesource_setup.sh
sudo apt-get install -y nodejs sudo apt-get install -y nodejs
sudo corepack enable corepack enable
echo "==========================================================================" echo "=========================================================================="
echo "Install Python 3.x..." echo "Install Python 3.x..."
@ -341,37 +341,37 @@ jobs:
echo "Error!" 1>&2 echo "Error!" 1>&2
exit 64 exit 64
- name: Destroy Build VM + resources # - name: Destroy Build VM + resources
if: always() # if: always()
shell: pwsh # shell: pwsh
run: | # run: |
echo "Destroying VM..." # echo "Destroying VM..."
az vm delete -g ghaDatatracker -n tmpGhaBuildVM --yes --force-deletion true # az vm delete -g ghaDatatracker -n tmpGhaBuildVM --yes --force-deletion true
$resourceOrderRemovalOrder = [ordered]@{ # $resourceOrderRemovalOrder = [ordered]@{
"Microsoft.Compute/virtualMachines" = 0 # "Microsoft.Compute/virtualMachines" = 0
"Microsoft.Compute/disks" = 1 # "Microsoft.Compute/disks" = 1
"Microsoft.Network/networkInterfaces" = 2 # "Microsoft.Network/networkInterfaces" = 2
"Microsoft.Network/publicIpAddresses" = 3 # "Microsoft.Network/publicIpAddresses" = 3
"Microsoft.Network/networkSecurityGroups" = 4 # "Microsoft.Network/networkSecurityGroups" = 4
"Microsoft.Network/virtualNetworks" = 5 # "Microsoft.Network/virtualNetworks" = 5
} # }
echo "Fetching remaining resources..." # echo "Fetching remaining resources..."
$resources = az resource list --resource-group ghaDatatracker | ConvertFrom-Json # $resources = az resource list --resource-group ghaDatatracker | ConvertFrom-Json
$orderedResources = $resources # $orderedResources = $resources
| Sort-Object @{ # | Sort-Object @{
Expression = {$resourceOrderRemovalOrder[$_.type]} # Expression = {$resourceOrderRemovalOrder[$_.type]}
Descending = $False # Descending = $False
} # }
echo "Deleting remaining resources..." # echo "Deleting remaining resources..."
$orderedResources | ForEach-Object { # $orderedResources | ForEach-Object {
az resource delete --resource-group ghaDatatracker --ids $_.id --verbose # az resource delete --resource-group ghaDatatracker --ids $_.id --verbose
} # }
echo "Logout from Azure..." # echo "Logout from Azure..."
az logout # az logout
# - name: Build Release Docker Image # - name: Build Release Docker Image
# uses: docker/build-push-action@v6 # uses: docker/build-push-action@v6