Lesson 1 of 4 Pipeline Fundamentals

Selecting GitHub Actions or Azure Pipelines

This lesson introduces each platform's structure, and explains how to choose between them.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish continuous delivery from continuous deployment.
  • Describe the structure of each platform.
  • Map equivalent concepts.
  • Choose a platform from stated requirements.

Continuous integration and continuous delivery

Continuous integration (CI) means that each change is merged often and verified automatically by a build and tests. Continuous delivery (CD) extends this so that each verified change can be released at any time, with a manual decision to release. Continuous deployment removes that decision, so every passing change reaches production automatically. An exam scenario that states no manual steps after merge is describing continuous deployment.

A pipeline implements these practices. It defines what happens to a change, in what order, and on which machines.

Sort into groups

CI, continuous delivery or continuous deployment?

Exam skills 3.3.1

Identify the practice each team description shows.

Log in to try this activity Interactive activities are free with an account.

How Azure Pipelines is structured

An Azure Pipelines YAML pipeline is a hierarchy. A pipeline contains stages, which are major divisions such as Build, Test and Deploy. A stage contains jobs, and each job runs on one agent. A job contains steps, and each step is a task, which is a packaged action, or a script. A run is one execution, and it produces logs, test results and artifacts.

An agent is the machine that runs a job, and agent pools group them. Service connections hold authentication details for external systems, and environments represent deployment targets. A pipeline is defined in a file, usually azure-pipelines.yml, or in the older classic visual designer. Azure Pipelines can build code from Azure Repos, GitHub, GitHub Enterprise Server, Bitbucket Cloud and other Git sources.

How GitHub Actions is structured

A GitHub Actions workflow is a YAML file in .github/workflows/. An event, such as a push, starts a workflow. A workflow contains jobs, each of which runs on a runner. A job contains steps, and a step runs a shell command or uses an action, which is a reusable unit of code from the Marketplace, a repository or the same repository.

GitHub Actions has no separate level called a stage: jobs with dependencies perform that role. It covers more than CI and CD, because workflows can respond to almost any repository event. For example, a workflow could label new issues or welcome a new contributor.

Mapping the concepts

The following table pairs the terms on each platform. Learning the pairs is worthwhile, since questions often mix them.

ConceptAzure PipelinesGitHub Actions
Definition fileazure-pipelines.yml, anywhere in the repository.github/workflows/*.yml
Top-level groupingStagesNone; jobs with needs
MachineAgent, selected with poolRunner, selected with runs-on
Reusable unitTaskAction
Start conditiontrigger, pr, schedules, resourceson
DependencydependsOnneeds
Reusable YAMLTemplatesReusable workflows and composite actions
Target protectionEnvironment checksEnvironment protection rules
Match the pairs

Azure Pipelines and GitHub Actions terms

Exam skills 3.3.1 · 3.3.5

Match each Azure Pipelines keyword or term with its GitHub Actions counterpart.

Log in to try this activity Interactive activities are free with an account.

Choosing between them

The first question is usually where the code lives, and the second is what the deployment process needs. The following comparison summarizes the factors.

GitHub Actions
Natural homeGitHub repositories
MarketplaceVery large
Event coverageMany repository events
Stages and approvalsEnvironments with protection rules
On-premises productGitHub Enterprise Server
Classic designerNo
Choose when Code is on GitHub, and the team wants one platform.
Azure Pipelines
Natural homeAzure DevOps projects
MarketplaceExtensions
Event coverageMainly code, schedules and pipelines
Stages and approvalsStages, and a broad set of checks
On-premises productAzure DevOps Server
Classic designerYes, for existing pipelines
Choose when The organization uses Azure DevOps or needs its richer checks.

Neither platform is limited to its own cloud or its own source. Azure Pipelines can build GitHub repositories, and GitHub Actions can deploy to Azure, other clouds and on-premises servers. A team migrating from Azure Pipelines to GitHub Actions can use GitHub Actions Importer to convert existing pipelines. A combination is also a valid design, for instance when code moves to GitHub while existing Azure Pipelines deployments stay in place.

For Azure deployment, both platforms support workload identity federation, so neither needs stored secrets. New work should use YAML on either platform, because a pipeline definition that lives in source control is reviewed, versioned and branched with the code.

The following diagram compares three deployment automation options for a startup that keeps all its code in GitHub.

Choosing deployment automation for a GitHub-only startup deploying to Azure Container Apps. GitHub Actions needs no further platform and authenticates with azure/login and a federated credential. Azure Pipelines would need a new Azure DevOps organization; Azure Automation runbooks are for operational tasks, not CI/CD.
The scenario is illustrative.
Scenario questions

Which automation platform?

Exam skills 3.3.1

Choose between GitHub Actions and Azure Pipelines for each organization.

Log in to try this activity Interactive activities are free with an account.
Worked example

Selecting a platform

A startup keeps all its code in GitHub, has no Azure DevOps organization, and wants to deploy a containerized API to Azure Container Apps with a minimum of tools to manage. Which automation solution should it choose?

GitHub Actions meets the need, because the code is already on GitHub and it needs no additional platform. The azure/login action with a federated credential handles authentication. Azure Pipelines could also do the work, but it would mean creating an Azure DevOps organization, which adds administration with no stated benefit. Azure Automation runbooks are designed for operational tasks, and they are not a CI/CD system.

Check yourself

What does GitHub Actions use in place of stages?

Show answer

Jobs with dependencies through needs. GitHub Actions has no stage level.

Exam Tips

Remember for the exam

  • Continuous deployment has no manual step; continuous delivery keeps one.
  • Azure Pipelines: pipeline, stages, jobs, steps. GitHub Actions: workflow, jobs, steps.
  • Azure Pipelines can build GitHub repositories.
  • Azure DevOps Server needs Azure Pipelines.
  • Prefer YAML in new work on either platform.