6

CI/CD using GitHub Actions Workflow directly from Visual Studio

 2 years ago
source link: https://dailydotnettips.com/ci-cd-using-github-actions-workflow-directly-from-visual-studio/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

CI/CD using GitHub Actions Workflow directly from Visual Studio

GitHub Actions makes it extremely easy for CI/CD to build, test, and deploy your code right from GitHub Repos. Github Actions Workflow has a robust integration with Microsoft Visual Studio. You can publish solutions using Github Action directly from Visual Studio just by following few steps. If you have your project in a GitHub repository and want to deploy the Azure solution, You can enable the CI/CD using the GitHub Actions workflow. Once the workflow is configured, Push it triggers and CI/CD for the targeted environments executed automatically with all Code. This post lets us learn how we can publish a solution directly from Visual Studio using Github Actions.

CI/CD using GitHub Actions Workflow

Firstly, ensure you have ensured the Preview Feature for “GitHub Action Support in Publish” is enabled. The Preview Features Page is available under Tools Options Environment > Preview Features.

Enable GitHub Actions Support in PublishEnable the Preview Features

Read More : Don’t See the Preview Features in Visual Studio – Try This

Once this feature is enabled, From the Visual Studio, open the solution from GitHub for the deployment. Right Click on Solution and Click on Publish

Click on PublishClick on Publish for deploying the solution from Visual Studio

With that, Publish Option will bring the Publish Wizard for Visual Studio, Where we need to select for Target Environment, Platform Services, Resources, and Other Options.

Publish Wizard - Select TargetPublish Wizard – Select Target

Let us choose the “Azure” as the target environment and select one Azure App Service for the Deployment. You can create an App Service directly from this Tooling Support or create one from Azure Portal and Map it here.

Publish Wizard - Select App Services for DeploymentPublish Wizard – Select App Services for Deployment

Once the Target and App Service is selected, moved to the “Deployment Type.” In this section, you must ensure to select “CI/CD using GitHub Actions Workflows.” This takes care of Integrating Publishing with GitHub Action and Generates the yml for build and deployment.

CI/CD using GitHub Actions workflowsCI/CD using GitHub Actions workflows

Finally, Click on Finish. It’s done. Visual Studio will take care of the rest of the thing. It will create all the necessary files for GitHub Action, for Build and Release. If you open your GitHub Repository and Move to the Action Tab, you will find the Build details and execution steps.

GitHub Action BuildGitHub Action Build

Moreover, after Workflow is completed successfully, Visual Studio Publish Wizard displays the status of the Workflow. In Addition, from this screen, you can select “Show Commit details” which will take you to the GitHub Action Tab.

GitHub Action Workflow SuccessfulGitHub Action Workflow Successful

View All Workflows

Finally, To view all the workflows, navigate to your GitHub Repository and move to Actions Tab. It will display all run workflow. After that, you can select each of them and dig dive to see what has been executed.

List of All Workflow from GitHub ActionsList of All Workflow from GitHub Actions

To Summarize, CI/CD using GitHub Actions can be easily established directly from Visual Studio by following few steps.

  • Firstly, Ensure to have the “GitHub Actions Support in Publish” is enabled.
  • Secondly, Open the Solution from GitHub Repository and Select Publish
  • Thirdly, From the Publish Wizard, select Target and Deployment Services
  • Finally, Choose Deployment Types as “CI/CD using GitHub Actions Workflows.
DON'T MISS OUT!
Subscribe To Newsletter For your Daily Development Tips and Tricks  

 Best Tips & Tricks on Microsoft Technology Platform 

We promise not to spam you. You can unsubscribe at any time.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK