Finally Visual Studio 2022 (the first-ever 64-bit version of Visual Studio) is released with great features, such as Hot Reload for .NET and C++ (Web, WPF, Windows Forms, you name it), cross-platform testing, etc.
In this post let's see the seamless integration Visual Studio 2022 provides with GitHub actions.
I have a repo hosted in GitHub and I wanted to enable CI/CD to deploy to an Azure App Service. I can do that with very few steps and even without leaving Visual Studio. Let's see how.
First I am right-clicking on the project and selecting Publish.Publish |
Then it's just following the steps in the wizard. I am including all the
steps, so we kind of have a complete guide.
I am deploying to Azure App Service. I am
selecting Azure and Clicking on Next.
Azure |
I already have a Linux Azure App Service which I am going to use. So I am
selecting Azure App Service (Linux) and clicking
on Next.
Azure App Service (Linux) |
I am selecting my target App Service and clicking on Next.
Select the App Service |
I am not going to be using any API Management, so I
am skipping this step and going to Next.
API Management - Skipping |
Now comes the interesting step. Visual Studio identifies my repo is
on GitHub and gives me an option to add GitHub Actions.
CI/CD using GitHub Actions workflows (generated yml file) |
So I am going ahead with selecting CI/CD using GitHub Actions workflows (generated yml file) and that's mostly it.
Visual Studio has already created the workflow yml file with the publishing
profile saved as an Action secret. Now I just need to commit and push the
changes to remote.
CI/CD |
And that is super easy.
I have this image from back in 2012, it's so true.
You can find the sample code here,
Happy Coding.
Regards,
Jaliya
Jaliya
No comments:
Post a Comment