How to Move from Azure DevOps to GitHub Actions
Azure DevOps has become one of the most popular CICD solutions in the DevOps space. In fact, it's even extremely popular outside of the Microsoft realm. There are several organizations that use AWS, for example, and use Azure DevOps for their CICD solution. It's fast, robust, and completely hosted for you, which means you don't have to worry about the overhead of infrastructure and platform management.
When Microsoft bought GitHub in 2018, GitHub Actions started to be developed almost instantly.This proves how crucial Microsoft thinks it is to learn DevOps. It's clear at this point, especially since Microsoft Build 2020, that GitHub Actions is here to stay and Microsoft wants people to use it. Although Azure DevOps will still be maintained, it appears that GitHub Actions will be the center point for innovation.
In this blog post, you're going to learn five key steps on how to move from Azure DevOps to GitHub Actions by understanding the key differences.
Prerequisites for GitHub Actions
To follow along with this blog post, you should have the following:
An understanding of source control and what it's used for
An understanding of Continuous integration and Continuous Delivery
Step 1: Creating a GitHub Account
If you already have a GitHub account, you can skip to step 2. If you don't, this section will show you how to set up a GitHub account so you can start committing code to repositories and eventually deploy that code with GitHub Actions.
Open up a web browser and go to GitHub's home page.
On the home page, type in a username, email, and password. Those credentials will be what you used to sign in to GitHub. Use a proper password as this will be similar to a root password. Once you type in the information, click the green Sign up for GitHub button.
To verify yourself, click on the blue Verify button and once complete, click the blue Join a free plan button.
The next page is for putting in what kind of work you are planning on doing — and how much programming experience you have. The levels offered for the programming experience are great because if you don't have much, GitHub will send you helpful tips.
Once you confirm all of the information, click the blue Complete setup button on the bottom of the page.
You will be asked to verify your email address for security purposes. Once complete, your GitHub account will be created.
Step 2: Understanding the Purpose of GitHub Actions
You may be wondering, "But wait, Microsoft put a ton of money and resources into Azure DevOps, so why GitHub Actions?" This is a question that developers and engineers alike have asked themselves. The answer: GitHub Actions is not Azure DevOps
Azure DevOps was created with the enterprise in mind — the ability to have an enterprise CICD solution. Before Azure DevOps, there were plenty of other CICD solutions like Jenkins and Travis CI. The problem was, for many organizations, that they didn't offer an enterprise solution — it wasn't maintained by someone or an organization specifically. Azure DevOps closes that gap by providing a solution for the people, by the people, for DevOps needs.
GitHub, on the other hand, must always remain neutral and not geared toward Microsoft specifically. GitHub's main focus is to host open-source projects. It's a place for all developers to go to check out new projects, get code ideas, open issues and concerns, and collaborate with fellow developers. Microsoft has made it clear that GitHub's mission will remain the same.
Step 3: Azure DevOps Pipelines vs Workflows
Quite simply, GitHub Actions uses workflows. Azure DevOps uses pipelines. They are fairly similar, but there are also differences.
In Azure DevOps, the way to build and deploy code is with pipelines. Pipelines currently come in two flavors:
Classic pipelines are a way to create build-and-release pipelines by using the UI. Within the UI, you can go in, select certain tasks, deployment targets, and deploy the code. If you're just building code in the CI process, then you would have a build pipeline that would do something like copying the code from source control and publishing an artifact.
YAML pipelines do the same thing you can do in a classic pipeline, but with code. This gives you the ability to have a codified pipeline that to store in source control where others can collaborate without having to click all over the place.
In GitHub, the way to build and deploy code is with a workflow. A workflow is very similar to YAML pipelines in Azure DevOps. You can write a pipeline as code and store it in GitHub. There are pre-made workflows that you can follow or you can start from scratch and build your own. With the built-in assistant, you don't have to worry about memorizing all of the YAML syntax.
For example, the screenshot below shows the built-in assistant's search results of anything that has to do with Python applications.
Step 4: Community Support
With Azure DevOps, although there was a community, it was pretty locked down to who was using it. If you had a question or a concern the best place to ask was a Microsoft forum or by calling Microsoft directly. The point: the community base is much smaller than GitHub. Trying to find an answer to a question, working closely with others on projects, and sharing with the world what you are doing is difficult. Especially because for anyone to actually see what you're doing they have to have login access to the Azure DevOps organization.
With GitHub, it's 100% different. There are over 11 million public repositories on GitHub, which means there are a ton of developers and a ton of collaboration. GitHub's key mission is to have the community support each other. This is something that you typically see very much in the open-source community.
If you are having an issue, for example, you can simply open up an issue request on a project. With GitHub actions being open source and not hidden in public repositories, you can have people from all of the world help you figure out any issues or concerns.
Step 5: Migrating YAML Pipelines to GitHub Actions Pipelines
Because there are differences in how the YAML pipelines are created in Azure DevOps vs GitHub Actions, it can be extremely cumbersome to migrate pipelines to GitHub. This will surely be a deciding factor for many organizations when thinking about making the switch.
Sam Smith, a colleague of mine and a software developer at Microsoft, wrote an application that helps in migrating pipelines from Azure DevOps to GitHub Actions CICD. For example, let's take the following Azure DevOps pipeline that deploys a .NET Core application.
trigger: – master variables: buildConfiguration: 'Release' buildPlatform: 'Any CPU' jobs: – job: Build displayName: 'Build job' pool: vmImage: windows-latest steps: – task: DotNetCoreCLI@2 displayName: 'Test dotnet code projects' inputs: command: test projects: | MyProject/MyProject.Tests/MyProject.Tests.csproj arguments: –configuration $(buildConfiguration) – task: DotNetCoreCLI@2 displayName: 'Publish dotnet core projects' inputs: command: publish publishWebProjects: false projects: | MyProject/MyProject.Web/MyProject.Web.csproj arguments: –configuration $(buildConfiguration) –output $(build.artifactstagingdirectory) zipAfterPublish: true – task: PublishBuildArtifacts@1 displayName: 'Publish Artifact' inputs: PathtoPublish: '$(build.artifactstagingdirectory)'
You can then copy/paste the YAML pipeline into the left box, for Azure DevOps, as shown in the screen below.
Once the code is pasted in, you can click the Process YAML button and on the right side appears the converted YAML.
The screenshot below shows the converted YAML.
You can find the tool here.
Today, you learned about five steps to help you in the transition from Azure DevOps to GitHub Actions CICD. You first learned about creating a GitHub account — if you don't already have one — and understanding the purpose of GitHub Actions.
You then moved into pipelines vs workflows and support for the open-source developer community. Finally, you learned about a new tool to convert Azure DevOps pipelines to Github Actions.
delivered to your inbox.