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