From 34d61f9a808d4f2b87b48d2f1b72f1d7ad7a5de5 Mon Sep 17 00:00:00 2001 From: Cameron Maloney Date: Thu, 6 Jun 2024 13:19:39 -0700 Subject: [PATCH] Update main_safehaven2.yml --- .github/workflows/main_safehaven2.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main_safehaven2.yml b/.github/workflows/main_safehaven2.yml index 778ea54..3f0742a 100644 --- a/.github/workflows/main_safehaven2.yml +++ b/.github/workflows/main_safehaven2.yml @@ -26,19 +26,25 @@ jobs: - name: Prepare artifact directory run: | - if (Test-Path -Path artifact\node-app.zip) { - Remove-Item -Path artifact\node-app.zip -Force + $artifactDir = "artifact" + $zipPath = "$artifactDir\node-app.zip" + if (Test-Path -Path $zipPath) { + Remove-Item -Path $zipPath -Force } - if (-Not (Test-Path -Path artifact)) { - New-Item -Path artifact -ItemType Directory + if (Test-Path -Path $artifactDir) { + Remove-Item -Recurse -Force $artifactDir } + New-Item -Path $artifactDir -ItemType Directory + shell: powershell + + - name: Copy files to artifact directory + run: | + Get-ChildItem -Path . -Recurse | Copy-Item -Destination artifact -Force -PassThru shell: powershell - name: Create artifact archive run: | - Copy-Item -Path "artifact\node-app.zip" -Force -PassThru | - Get-ChildItem | - Compress-Archive -Path .\* -DestinationPath "artifact\node-app.zip" + Compress-Archive -Path artifact\* -DestinationPath artifact\node-app.zip shell: powershell - name: Upload artifact for deployment job