-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from NetCoreTemplates/feature/kamal-deployment
feat: add Kamal deployment configuration
- Loading branch information
Showing
4 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ on: | |
workflows: ["Build"] | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ on: | |
- master | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Microsoft.Extensions.Diagnostics.HealthChecks; | ||
|
||
[assembly: HostingStartup(typeof(MyApp.HealthChecks))] | ||
|
||
namespace MyApp; | ||
|
||
public class HealthChecks : IHostingStartup | ||
{ | ||
public class HealthCheck : IHealthCheck | ||
{ | ||
public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken token = default) | ||
{ | ||
// Perform health check logic here | ||
return HealthCheckResult.Healthy(); | ||
} | ||
} | ||
|
||
public void Configure(IWebHostBuilder builder) | ||
{ | ||
builder.ConfigureServices(services => | ||
{ | ||
services.AddHealthChecks() | ||
.AddCheck<HealthCheck>("HealthCheck"); | ||
|
||
services.AddTransient<IStartupFilter, StartupFilter>(); | ||
}); | ||
} | ||
|
||
public class StartupFilter : IStartupFilter | ||
{ | ||
public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next) | ||
=> app => { | ||
app.UseHealthChecks("/up"); | ||
next(app); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters