liveBook · Manning

GitHub Actions

As explained in Learn Docker in a Month of Lunches, Second Edition

GitHub Actions is a workflow automation service integrated with GitHub repositories for building, testing, and deploying software.

A build that works only on a developer’s machine gives the team unreliable feedback. GitHub Actions runs a CI/CD workflow when changes are pushed to a GitHub repository. A temporary runner checks out the code, executes the configured steps, and is cleaned up afterward. section 16.1

Define the workflow in YAML under `.github/workflows/`. Keep the GitHub-specific steps small: let the workflow check out the repository and call a script, while the script coordinates Docker builds and tests. You can then run the same script locally to debug a failure or adapt it for another CI/CD service. section 16.1 section 16.5

Listing 16.3 A simple GitHub workflow to run a PowerShell script
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: build
        working-directory: cicd
        run: ./build.ps1
        shell: pwsh

This build job uses an Ubuntu runner, checks out the repository, and runs `cicd/build.ps1` with PowerShell. The build logic stays outside the workflow YAML. section 16.1

Push a build and check the result

First run `./build.ps1` locally. Move `build.yaml` into `.github/workflows/`, then commit and push it; check the run in the repository’s Actions page. To test the failure path, enable the supplied failing test and rerun the build. After restoring the passing test, commit and push again to check that the next run succeeds. section 16.1

For a production pipeline, private repositories and packages need additional authentication configuration. Workflow design also involves a trade-off: one workflow can show job dependencies together in the UI, while separate stages are easier to run independently. A further practice task is to test a script that pushes Linux and Windows manifest lists to GHCR locally, then run it from a workflow. section 16.5 section 16.6

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Walks through runner execution and a working YAML job, but leaves private-package authentication configuration unspecified.
Examples
Uses a PowerShell build workflow, a deliberately failing unit test, and a manifest-list publishing lab.
What it assumes
Requires a GitHub account, Git, PowerShell 7+, and a Docker setup using Linux containers; treats GitHub CLI as optional.
What you can do after
Operate/configure it: run a scripted build in GitHub Actions and check its failure and recovery after pushes.
How it connects
Connects GitHub workflows with Docker multi-stage builds, Docker Compose, PowerShell scripts, and CI/CD portability.

Also explained in

Compare how 10 books explain GitHub Actions →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.