liveBook · Manning

GitHub Actions

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

GitHub Actions is a workflow automation platform for building, testing, and deploying software from repositories hosted on GitHub.

GitHub Actions runs automated workflows in response to events in a GitHub repository. A push can start a workflow that tests code or deploys a microservice. The workflow lives alongside the code it uses, so repository changes can trigger the commands needed to check and release that code. section 8.1 section 8.7.1

Start with a small YAML workflow configuration and a shell script. The simplest working example runs the script after a code push and prints “hello world” in the workflow output. Fork the example repository, clone your fork, and enable workflows in its Actions tab. Change the script, commit, and run git push; then check the workflow history on GitHub to see the result. The terminal push alone does not show whether the workflow ran. section 8.7.4 section 8.7.8

Once the trigger works, give the workflow a useful job:

  • Continuous integration (CI) runs automated tests and other checks as code changes are pushed, providing early warning of problems. section 8.11
  • Continuous deployment (CD) runs build, publish, and deployment commands automatically. A single-microservice deployment to Kubernetes provides a pattern to reuse for other services. section 8.0 section 8.7.11
  • Keep deployment commands in shell scripts that can also be tested locally. Configure them with environment variables; use GitHub secrets for sensitive values, github.sha for an image version, and envsubst to fill parameters in deployment configuration. section 8.11

A production pipeline can delegate to several scripts that build, publish, and deploy microservices to Kubernetes. Practice manual deployment first: if the automated run fails, repeating the steps locally or manually can help isolate the problem. Reliable automation matters more as the number of microservices grows; manual or unreliable deployments become difficult to scale. section 10.10 section 10.13 section 8.11

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Builds from a minimal push-triggered script to CI and Kubernetes CD, with locally testable scripts and deployment configuration.
Examples
Uses a push-triggered “hello world” workflow and a production microservice pipeline that builds, publishes, and deploys to Kubernetes.
What it assumes
Starts GitHub Actions with a minimal workflow; assumes Git use and relies on Docker and kubectl skills for deployment.
What you can do after
Build it from scratch: trigger tests and microservice deployment from GitHub pushes using YAML workflows and shell scripts.
How it connects
Links continuous integration, continuous deployment, Docker, Kubernetes, shell scripts, GitHub secrets, and environment variables.

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 Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.