mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-14 16:02:50 +08:00
Configures deployment to netlify
This commit is contained in:
parent
c2da268129
commit
3ac63d2670
@ -39,6 +39,7 @@
|
||||
<PackageReference Include="Statiq.Common" Version="1.0.0-beta.56" />
|
||||
<PackageReference Include="Statiq.Web" Version="1.0.0-beta.42" />
|
||||
<PackageReference Include="MinVer" PrivateAssets="All" Version="2.3.1" />
|
||||
<PackageReference Include="Statiq.Web.Netlify" Version="1.0.0-beta.42" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -34,7 +34,6 @@ namespace Docs
|
||||
i.AddSingleton(new TypeNameLinks());
|
||||
})
|
||||
.ConfigureSite("spectreconsole", "spectre.console", "main")
|
||||
.ConfigureDeployment(deployBranch: "docs")
|
||||
.AddShortcode("Children", typeof(ChildrenShortcode))
|
||||
.AddShortcode("ColorTable", typeof(ColorTableShortcode))
|
||||
.AddShortcode("EmojiTable", typeof(EmojiTableShortcode))
|
||||
|
@ -42,8 +42,8 @@ namespace Docs
|
||||
|
||||
public static class Deployment
|
||||
{
|
||||
public const string GitHubToken = "GITHUB_TOKEN";
|
||||
public const string TargetBranch = "DEPLOYMENT_TARGET_BRANCH";
|
||||
public const string NetlifySiteId = "NETLIFY_SITE_ID";
|
||||
public const string NetlifyAccessToken = "NETLIFY_ACCESS_TOKEN";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Statiq.App;
|
||||
using Statiq.Common;
|
||||
using Statiq.Web;
|
||||
|
||||
namespace Docs.Extensions
|
||||
{
|
||||
@ -15,11 +16,5 @@ namespace Docs.Extensions
|
||||
}
|
||||
return bootstrapper;
|
||||
}
|
||||
|
||||
public static Bootstrapper ConfigureDeployment(this Bootstrapper bootstrapper, string deployBranch)
|
||||
{
|
||||
bootstrapper?.AddSetting(Constants.Deployment.TargetBranch, deployBranch);
|
||||
return bootstrapper;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Statiq.Common;
|
||||
using Statiq.Web.GitHub;
|
||||
using Statiq.Web.Netlify;
|
||||
|
||||
namespace Docs.Pipelines
|
||||
{
|
||||
@ -10,12 +11,11 @@ namespace Docs.Pipelines
|
||||
Deployment = true;
|
||||
OutputModules = new ModuleList
|
||||
{
|
||||
new DeployGitHubPages(
|
||||
Config.FromSetting<string>(Constants.Site.Owner),
|
||||
Config.FromSetting<string>(Constants.Site.Repository),
|
||||
Config.FromSetting<string>(Constants.Deployment.GitHubToken))
|
||||
.ToBranch(Config.FromSetting<string>(Constants.Deployment.TargetBranch))
|
||||
new DeployNetlifySite(
|
||||
siteId: Config.FromSetting<string>(Constants.Deployment.NetlifySiteId),
|
||||
accessToken: Config.FromSetting<string>(Constants.Deployment.NetlifyAccessToken)
|
||||
)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user