mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-08-02 10:15:58 +08:00
Configures deployment to netlify
This commit is contained in:

committed by
Patrik Svensson

parent
c2da268129
commit
3ac63d2670
@ -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)
|
||||
)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user