From f4f8ba663d103797863969c09c6c6c313532ba10 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sat, 19 Aug 2023 22:01:24 -0700 Subject: [PATCH] Added log upload to workflow --- .github/workflows/azure-ipam-testing.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/azure-ipam-testing.yml b/.github/workflows/azure-ipam-testing.yml index 75f4e3a..ff71d75 100644 --- a/.github/workflows/azure-ipam-testing.yml +++ b/.github/workflows/azure-ipam-testing.yml @@ -55,4 +55,20 @@ jobs: sleep 30 echo "Time: $(date +'%T')" + - name: "Upload Logs" + working-directory: "logs" + run: | + $archiveName = "ipam-" + (Get-Date -UFormat "%Y-%m-%d_%I-%M-%S_%p").tostring() + ".zip" + Compress-Archive -Pat ./* -DestinationPath /tmp/$archiveName + $storage = Get-AzStorageAccount -Name "ipamghactionlogs" -ResourceGroupName "Logging-RG" + $context = $storage.Context + @uploadDetails = @{ + File = "/tmp/$archiveName" + Container = "deploy-logs" + Blob = $archiveName + Context = $context + StandardBlobTier = "Hot" + } + Set-AzStorageBlobContent @uploadDetails + - run: echo "${{ github.job }} status is ${{ job.status }}."