Restructuing
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
var deployDir = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", ".."));
|
||||
var webDir = Path.GetFullPath(Path.Combine(deployDir, "..", "Web"));
|
||||
var webProject = Path.Combine(webDir, "Web.csproj");
|
||||
var webDir = Path.GetFullPath(Path.Combine(deployDir, "..", "Standalone"));
|
||||
var webProject = Path.Combine(webDir, "Standalone.csproj");
|
||||
var publishDir = Path.Combine(Path.GetTempPath(), "chrono-deploy", Guid.NewGuid().ToString());
|
||||
var deploymentToken = Environment.GetEnvironmentVariable("Chrono_DeployToken") ??
|
||||
throw new InvalidOperationException("Chrono_DeployToken environment variable not set.");
|
||||
var deployEnv = Environment.GetEnvironmentVariable("Chrono_DeployEnv") ?? "preview";
|
||||
|
||||
// 1. Publish
|
||||
Console.WriteLine("Publishing Web project...");
|
||||
Console.WriteLine("Publishing Standalone project...");
|
||||
Run("dotnet", $"publish \"{webProject}\" -c Release -o \"{publishDir}\"");
|
||||
|
||||
var wwwroot = Path.Combine(publishDir, "wwwroot");
|
||||
@@ -20,7 +20,7 @@ if (!Directory.Exists(wwwroot))
|
||||
}
|
||||
|
||||
// 2. Deploy
|
||||
Console.WriteLine("Deploying to Azure Static Web Apps...");
|
||||
Console.WriteLine("Deploying to Azure Static Standalone Apps...");
|
||||
Run("swa.cmd",
|
||||
$"deploy \"{wwwroot}\" --deployment-token \"{deploymentToken}\" --app-location \"{webDir}\" --env \"{deployEnv}\"");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user