chapter eight

8 Complex deployments using GitHub Actions

 

This chapter covers

  • Deploying the Toma Toe (Chapter 7) case using GitHub Actions
  • Connecting to Azure from GitHub Actions
  • Handle secrets when using GitHub Actions
  • Monitor workflows while they are running

Git is currently one of the most popular source control systems around. The GitHub platform, originally built around this source control system, is one of the most popular platforms for storing (code) projects. You can access GitHub through their website (https://github.com). Throughout the years, GitHub has grown to a more mature application lifecycle management platform including an integrated automation system called GitHub Actions.

GitHub Actions is the equivalent of Azure DevOps Pipeline that allows you to hook into events in your source control to implement CI/CD solutions in GitHub. Although both GitHub Actions and Azure DevOps pipeline have a lot in common, there are some differences between the two. This chapter will touch upon differences between Azure DevOps and GitHub Actions and will use the same use-case as Chapter 7. The same deployment process will be created, but now using GitHub Actions.

8.1  Forking a repository

8.2  Getting to know GitHub Actions

8.2.1  Workflow events

8.2.2  Runners

8.2.3  Jobs

8.2.4  Steps

8.2.5  Actions

8.3  Building a GitHub Actions workflow

8.3.1  Adding a job to a GitHub Actions workflow

8.4  The deployment phase in GitHub Actions

8.4.1  Connecting to Azure from your GitHub Workflow

8.4.2  Generating a Service Principal using the Azure CLI

8.5  Deploying ARM templates from GitHub Actions

8.5.1  Completing the deployment

8.6  Summary