Over a million developers have joined DZone.

Build Pipelines for GitHub Projects

DZone's Guide to

Build Pipelines for GitHub Projects

Take a look at how to build a pipeline for Azure Pipelines with an integration to GitHub.

· Open Source Zone ·
Free Resource

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.

Azure Pipelines

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.

To get your hands on it, head to the GitHub Marketplace and set up a plan for your account. Remember, it is free like many other CI services out there, but with a lot more to offer.

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.

Creating your first build pipeline for a GitHub project
If you can't find a specific repository, click on My repositories and then select All repositories. This will fetch the entire list, and then you can filter by the name.
See all repositories

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.

There is a series of examples of build pipelines you can use, too, like for Java applications and more. Check the full list.

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.

devops ,github ,pipeline ,azure pipelines ,open source ,integration

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}