How to deploy MVC application on GitHub for demonstration purposes?
Loading
How to deploy MVC application on GitHub for demonstration purposes?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Feb 18, 2024, 5:12 PM
You can have one website for free in Netlify. I am not sure what the requirements are but a website for demonstration purposes would probably qualify. They make it easy to deploy from GitHub.
https://www.netlify.com
Sam HobbsPosted Feb 18, 2024, 4:35 AM
I am nearly certain it is not possible to host a MVC application in GitHub. GitHub Pages only support static websites. You can use ASP.NET Core Webassembly Razor applications to generate a static webiste that can be hosted in GitHub but when I did that I encountered a problem with navigation that I am told is the result of how GitHub Pagews work. I assume you do not want to use an ASP.NET Core Webassembly Razor application thererore I won't get into that.
You will need a host. The details of how to deploy depends on the host. Most of them have instructions for you to use. The general procedure is, you push the application to GitHub and then a GitHub Workflow builds the application and does something to deploy it to the host. Perhaps deployment is a matter of copying the file(s) from GitHub to the host.
I am speaking from experience, no AI was used to generate my answer.
Jayraj ChhayaPosted Feb 15, 2024, 9:36 AM
To deploy an MVC application on GitHub for demonstration purposes, you can follow these steps:
Create a GitHub repository: Start by creating a new repository on GitHub. Give it a meaningful name and description.
Clone the repository: Clone the repository to your local machine using Git. Open a terminal or command prompt and run the following command:
Build and publish the MVC application: Open the MVC application in your preferred development environment, such as Visual Studio. Build the application and publish it to a folder on your local machine.
Commit and push the published files: Navigate to the folder where you published the MVC application. Use the following commands to commit and push the files to the GitHub repository:
Enable GitHub Pages: Go to the repository settings on GitHub and scroll down to the GitHub Pages section. Choose the branch you want to use for deployment (e.g., master) and save the settings.
Access the deployed application: After a few moments, GitHub will deploy your MVC application. You can access it by visiting the GitHub Pages URL, which will be in the format
https://.github.io/ .By following these steps, you can easily deploy your MVC application on GitHub for demonstration purposes.