Build Pipelines for GitHub Projects
Take a look at how to build a pipeline for Azure Pipelines with an integration to GitHub.
Join the DZone community and get the full member experience.Join For Free
If you have a project on GitHub, chances are you will want to continually build it to ensure it is still compiling, that it is still working — meaning, all tests are passing — and possibly create a release of the project so others, including yourself, can simply use the latest version without having to manually compile/package it. For all that, you will need a build pipeline.
GitHub now has a feature called GitHub Actions that can be used for many things, especially workflows that are triggered by events in your repository — like "issue created" or "push." And while developers can be very creative and extrapolate the boundaries of what GitHub Actions is aiming for, the reality is that for complex applications continuous integration and delivery, you are more likely better off with a platform that gives you control over build agents, software provisioned in them, custom webhooks, human control over workflows, and so on.
That's where Azure Pipelines comes in. It's free and integrated with GitHub.
This service comes with cloud-hosted pipelines for Linux, macOS, and Windows with 10 free parallel jobs and unlimited minutes for open source projects right from the start.
Once you log in — whether you create an account or use an existing Microsoft/Live account — you should see the screen displayed that's the first of the two above.
If you don't have an organization created already, do it. I recommend creating one with the same name as your GitHub user. Perhaps even adding "-github" suffix, just in case you use Azure DevOps for other things later on.
The screen to create an organization and a project will look like the one that's the second of the two above. You need to select which data center will hold your environment. Choose the closest one to your physical location for lower latency.
If all goes well, you will then move on to this next screen to confirm the integration between your GitHub account and your Azure Pipelines environment.
This should complete the process of configuring and activating Azure Pipelines for its use with your GitHub projects. The next step is really to create your very first pipeline.
You should be redirected to this screen below, where you can then select the repository of your project. Since you created a project before, just select the repository with the same name. Ideally, you should have a project on Azure DevOps with its name matching your project on GitHub — not a technical requirement, but helps you keep track of things.
Once you select a project, the flow will open an editor for a file named azure-pipelines.yml. From now on, it is really up to you and the type of your project on how to define a specific build pipeline. Move on to the documentation and learn more.
I'll be writing another story soon, specifically for a build pipeline of JavaFX desktop applications, to show you how to use the Mac OS, Windows, and Linux build agents all at once, for cross-platform continuous delivery.
Published at DZone with permission of Bruno Borges. See the original article here.
Opinions expressed by DZone contributors are their own.