Background

What is CI/CD?

According to Red Hat, CI/CD is defined as:

Continuous integration (CI) refers to the practice of automatically and frequently integrating code changes into a shared source code repository. Continuous delivery and/or deployment (CD) is a 2 part process that refers to the integration, testing, and delivery of code changes. Continuous delivery stops short of automatic production deployment, while continuous deployment automatically releases the updates into the production environment.

Essentially, after writing code, you can think of CI/CD as the pipeline in which brings your code from local to production in an (almost) automated fashion.

As seen in the diagram above, it is primarily responsible for the following:

  1. Building your project

  2. Running unit and (maybe) integration tests

  3. Deployments to production

A CI/CD pipeline may not include every step. For instance, you might only want the CI/CD pipeline to run unit tests, or perform linting for a pull request. It is not a one-size-fits-all mechanism, but rather a "pick as you go" approach.

CI/CD pipelines are often built as part of the version control systems. This means that when you push your code onto a repository, the CI/CD pipeline will start.

Some common CI/CD software include:

  1. TravisCI

  2. CircleCI

  3. Jenkins

  4. Github Actions

What is Github Actions?

One of the most common CI/CD tools is Github Actions due to Github's pervasiveness in personal, open-source, and commercial software.

https://github.com/features/actions

Github Actions was first released in 2018, and it aims to be a tightly integrated CI/CD tool that works out-of-the-box with Github repositories.

https://github.com/resources/whitepapers/actions

It is designed to integrate with existing Github flows, reducing the overhead involved in setting up a CI/CD pipeline.

Github Actions also goes beyond simple CI/CD pipelines as it can integrate with other Github events, such as running on a fork, issue created, or release.

The rest of this guide will cover the core syntax and concepts of Github Actions, common workflows you can achieve with Github Actions, and some other slightly unconventional workflows that you can achieve with Github Actions.

Last updated