Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jayraj ChhayaRank #304 · 8.2K reputationPosted Feb 15, 2024, 4:36 AM EST
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:
git cloneBuild 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:
git add . git commit -m "Initial commit" git push origin masterEnable 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.
Sam HobbsRank #107 · 20.5K reputationPosted Feb 17, 2024, 11:35 PM EST
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.
Sam HobbsRank #107 · 20.5K reputationPosted Feb 18, 2024, 12:12 PM EST
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