How to continuously deploy and run my app on a Linux host?

Mahmudul Hasan 1 Reputation point
2021-04-13T09:09:17.817+00:00

Hello, I have a web app written in .NET 5, I bought a Linux VPS, set up Nginx and other stuff to run my app, pushed the release file via FTP using Visual Studio. Now if I try dotnet myapp.dll, the app fires up and I can access it.

The problem is if I make a change and push the newly modified-release files, each and every time I have to restart the app to see the changes. Which is a hassle. I want to automate this task.

I found a GitHub action that can build and deploy to my FTP server. But how can I automate the dotnet myapp.dll thing each time I push the code to my repo?

Here are few steps that will help to illustrate the scenario -

  1. I made some changes to my app
  2. I will push it to my repository (GitHub or Azure DevOps)
  3. Action will build the app
  4. If the build is successful, it will push it to the FTP (GH Action or DevOps Pipe-line)
  5. When the new file arrives at the FTP, an action will restart the app and make the changes active.

alternatively,

  1. I made some changes to my app
  2. I will build the app and publish it to the FTP via Visual Studio
  3. When the new file arrives at the FTP, an action will restart the app and make the changes active.

How can I do this?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,154 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,226 questions
{count} votes