# Background

## What is CI/CD?

According to [Red Hat](https://www.redhat.com/en/topics/devops/what-is-ci-cd), CI/CD is defined as:

> [Continuous integration](https://www.redhat.com/en/topics/integration) (CI) refers to the practice of [**automatically**](https://www.redhat.com/en/topics/automation) **and frequently integrating code changes into a shared source code repository.** [**Continuous delivery**](https://www.redhat.com/en/topics/devops/what-is-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.

<figure><img src="/files/CaOigRUQuVhAXmbH5r8w" alt=""><figcaption></figcaption></figure>

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.

{% @github-files/github-code-block url="<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.

{% @github-files/github-code-block url="<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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.nushackers.org/hackerschool/ci-cd-with-github-actions/background.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
