dotnet-api-template ASP.NET Core Web API · .NET 8

Mindfree Automated Delivery System

Deployment live — this environment was deployed automatically on push.
Project
mindfree-hub-api
Branch
main
Commit
d4c4ce0
Status
● Live

Database

✓ Database connected — showing last deploy_log records.
#ProjectBranchCommitDeployed at (UTC)
1mindfree-hub-apimaind4c4ce02026-09-30 02:26:35Z

How to use this template

1
Create a new repo from this template

On GitHub, click "Use this template" → "Create a new repository". Set the owner to Mindfree-2 and make the repo private — the self-hosted runner only works on private repositories.

2
Push to deploy

Every push to any branch triggers the CI/CD pipeline automatically within ~2 minutes. Each branch gets its own isolated URL:

  • main → {project}.mindfree.info
  • staging → {project}.staging.mindfree.info
  • any other branch → {branch}.{project}.dev.mindfree.info
3
Write your code

Add controllers under src/Api/Controllers/. Decorate them with [ApiController] and [Route("[controller]")]. Register services and middleware in Program.cs. Models go in a Models/ folder you create.

4
Add secrets & environment variables

Go to your repo → Settings → Secrets and variables → Actions. Secrets are injected as environment variables at deploy time and available to your app at runtime via Environment.GetEnvironmentVariable().

Available Endpoints

RouteDescription
GET /This welcome page with deployment info
GET /healthHealth check — returns ok, used by the deploy script to confirm the app is up
GET /infoDeployment info as JSON — { project, branch, commit }
GET /swaggerSwagger UI — available in Development environment only
GET /test-secretReturns TEST_SECRET env var — remove before production
GET /test-storageAppends a line to /data/test.txt and returns contents — remove before production

Project Structure

dotnet-api-template/
└── src/Api/
    ├── Controllers/
    │   └── InfoController.cs    ← example controller, add yours here
    ├── Program.cs               ← services, middleware & minimal-API routes
    ├── Api.csproj               ← NuGet dependencies
    └── appsettings.json         ← app configuration