I have an ASP.NET Core Web API project. I have hosted this project on my local IIS Windows server. I have also uploaded this project to Git Hub. Now I want to set up the auto-publish/deploy method in my project so that with each git push github can publish my project to the local IIS
Note: Please, do not provide links I have already explored a lot on Google. I want that yml file commands.
Loading

Vijay Pratap SinghPosted Jun 23, 2023, 6:03 AM
@Deepak Rawat
Deepak RawatPosted Jun 23, 2023, 4:35 AM
To set up auto-publish/deploy for your ASP.NET Core Web API project on your local IIS using a YAML file, you can follow these steps:
Create a file named
.github/workflows/deploy.ymlin your GitHub repository. This file will define the deployment workflow.Open the
deploy.ymlfile and add the following content:Make sure to replace "YourWebsiteName" with the name of your IIS website.
Commit and push the
deploy.ymlfile to your GitHub repository.The YAML file is now configured to run the deployment workflow whenever you push changes to the
mainbranch.Note: Ensure that your IIS website is correctly set up and configured to host ASP.NET Core applications. Additionally, you may need to adjust the workflow file if your project has specific requirements, such as using a different branch or modifying the build/publish commands.
With this setup, whenever you push changes to your GitHub repository's
mainbranch, GitHub Actions will automatically trigger the deployment workflow defined in thedeploy.ymlfile. The workflow will build and publish your ASP.NET Core Web API project and deploy it to your local IIS website.