From 9ef921f7726f2c5b0072425ffa92182a372c8914 Mon Sep 17 00:00:00 2001 From: 6d486f49 Date: Wed, 17 Jun 2026 16:42:09 -0400 Subject: [PATCH] GSR_DeployEnv ENV variable --- GSR/Deploy/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GSR/Deploy/Program.cs b/GSR/Deploy/Program.cs index 9017895..79ad2d7 100644 --- a/GSR/Deploy/Program.cs +++ b/GSR/Deploy/Program.cs @@ -5,6 +5,7 @@ var webDir = Path.GetFullPath(Path.Combine(deployDir, "..", "Web")); var webProject = Path.Combine(webDir, "Web.csproj"); var publishDir = Path.Combine(Path.GetTempPath(), "gsr-deploy", Guid.NewGuid().ToString()); var deploymentToken = Environment.GetEnvironmentVariable("GSR_DeployToken") ?? throw new InvalidOperationException("GSR_DeployToken environment variable not set."); +var deployEnv = Environment.GetEnvironmentVariable("GSR_DeployEnv") ?? "preview"; // 1. Publish Console.WriteLine("Publishing Web project..."); @@ -19,7 +20,7 @@ if (!Directory.Exists(wwwroot)) // 2. Deploy Console.WriteLine("Deploying to Azure Static Web Apps..."); -Run("swa.cmd", $"deploy \"{wwwroot}\" --deployment-token \"{deploymentToken}\" --app-location \"{webDir}\""); +Run("swa.cmd", $"deploy \"{wwwroot}\" --deployment-token \"{deploymentToken}\" --app-location \"{webDir}\" --env \"{deployEnv}\""); Console.WriteLine("Deploy successful!"); return 0;