Featured Article

Deploy Asp Net Apps to GitHub Pages Fast

Kenneth Jul 13, 2026

ASP.NET and GitHub Pages, two powerful platforms in their respective domains, can be seamlessly integrated to streamline your web development workflow. While ASP.NET excels in building enterprise-level web applications, GitHub Pages offers easy, centralized hosting. Let's delve into how you can leverage these two for a robust and efficient development experience.

My Porfolio Powered by ASP.NET Core blazor Web Assembly (.NET 8)
My Porfolio Powered by ASP.NET Core blazor Web Assembly (.NET 8)

Before we dive into the integration process, it's crucial to understand that ASP.NET doesn't directly support GitHub Pages due to differences in server models. GitHub Pages runs on Jekyll, a static site generator, while ASP.NET is a dynamic web application framework. However, with a workaround involving the use of Git and Azure Static Web Apps, you can indeed host your ASP.NET projects on GitHub Pages.

GitHub - JavierCanon/Social-Office-Login: 🔐 🎭 Simple email login to asp.net website or .net app using OAuth providers.
GitHub - JavierCanon/Social-Office-Login: 🔐 🎭 Simple email login to asp.net website or .net app using OAuth providers.

Setting Up ASP.NET Core with Azure Static Web Apps

Azure Static Web Apps is a service by Microsoft that supports hosting static web apps alongside an API. It's ideal for hosting ASP.NET Core projects on GitHub Pages.

the dashboard is full of different data
the dashboard is full of different data

First, you need to create and configure an Azure Static Web Apps instance. This involves setting up a repository in your GitHub account, initializing the ASP.NET Core project within it, and utilizing the 'Azure AMD' workflow in GitHub Actions to deploy the app.

Initializing the ASP.NET Core Project

GitHub - MoienTajik/AspNetCore-Developer-Roadmap: Roadmap to becoming an ASP.NET Core developer in 2026
GitHub - MoienTajik/AspNetCore-Developer-Roadmap: Roadmap to becoming an ASP.NET Core developer in 2026

Begin by initializing a new ASP.NET Core project in your local development environment. Use the 'minimal API' or 'web app' template, as these are compatible with Azure Static Web Apps.

Once initialized, push your project to the GitHub repository. This will trigger the GitHub Actions workflow to build and deploy your app to the Azure Static Web Apps instance.

Configuring GitHub Actions

asp net github pages
asp net github pages

In your repository, create a new folder named '.github/workflows' (if it doesn't exist), and inside it, create a new file named 'deploy-aspnet-core.yaml'. This file contains the workflow to build and deploy your app. Ensure you configure the correct environment variables and secrets for Azure Static Web Apps.

The workflow should include steps for 'checkout', 'setup .NET SDK', 'restore', 'build', 'test', and 'deploy' your ASP.NET Core project. Once configured, GitHub Actions will automate this process every time you push changes to your repository.

Deploying ASP.NET Core Projects to GitHub Pages

the h - mahmoud / job board is displayed in this screenshote
the h - mahmoud / job board is displayed in this screenshote

Now that you have Azure Static Web Apps set up, let's deploy your ASP.NET Core project. This involves pushing your changes to the Git repository, which triggers the GitHub Actions workflow to build and deploy your app to Azure Static Web Apps.

You can monitor the progress of the deployment in the 'Actions' tab of your repository. Once complete, your ASP.NET Core app will be live, with the URL being '.web.app' on the Azure Static Web Apps domain.

two screens showing different types of web pages
two screens showing different types of web pages
a web page with an image of a man in blue shirt and text that reads,
a web page with an image of a man in blue shirt and text that reads,
GitHub - BedirhanErk/Asp.Net-Mvc5-Sozluk-Uygulamasi: Asp.Net Mvc5 Adsız Sözlük
GitHub - BedirhanErk/Asp.Net-Mvc5-Sozluk-Uygulamasi: Asp.Net Mvc5 Adsız Sözlük
GitHub - BurakTemelkaya/ASP.NET_Core_ProjeKampi: ASP.NET Core MVC & N Tier Architecture
GitHub - BurakTemelkaya/ASP.NET_Core_ProjeKampi: ASP.NET Core MVC & N Tier Architecture
GitHub - brkcaliskann/StajTakip: ASP.NET Mvc yazılım mimarisi kullanılarak hazırlanmış, üniversitelerin staj dönemlerinde öğrenciler ve eğitim birimlerinin kullanabilmesi adına geliştirilmiş bir web projesidir.
GitHub - brkcaliskann/StajTakip: ASP.NET Mvc yazılım mimarisi kullanılarak hazırlanmış, üniversitelerin staj dönemlerinde öğrenciler ve eğitim birimlerinin kullanabilmesi adına geliştirilmiş bir web projesidir.
GitHub - zcomert/btk-akademi-aspnet-core-web-api: BTK Akademi ASP.NET Core Web API Eğitimi
GitHub - zcomert/btk-akademi-aspnet-core-web-api: BTK Akademi ASP.NET Core Web API Eğitimi
GitHub - dotnet/AspNetCore.Docs: Documentation for ASP.NET Core
GitHub - dotnet/AspNetCore.Docs: Documentation for ASP.NET Core
GitHub - serenity-is/Serenity: Business Apps Made Simple with Asp.Net Core MVC / TypeScript
GitHub - serenity-is/Serenity: Business Apps Made Simple with Asp.Net Core MVC / TypeScript
GitHub - fcetinkaya/Asp.Net-E-Ticaret-Sitesi_Ecommere: Asp.Net - E-Ticaret Sitesi (Ecommere)
GitHub - fcetinkaya/Asp.Net-E-Ticaret-Sitesi_Ecommere: Asp.Net - E-Ticaret Sitesi (Ecommere)

Custom Domain

To use a custom domain, you'll need to update the DNS settings for your domain. Point the 'www' and '@' subdomains to the Azure Static Web Apps instance. Ensure you include the required CNAME record for verification in your DNS settings.

Once configured, Azure will validate and activate the custom domain. Your ASP.NET Core project will now be live on your custom domain.

In conclusion, while ASP.NET doesn't directly support GitHub Pages, utilizing Azure Static Web Apps and GitHub Actions allows for a seamless integration. This workflow ensures your ASP.NET Core projects can be hosted efficiently on GitHub. So, start exploring the power of these platforms today!