# GitHub Actions

> Build pipelines as YAML workflows triggered by repository events, using jobs, reusable actions, secrets and OIDC to the cloud. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/github-actions
Last updated: 2026-11-28

Build pipelines as YAML workflows triggered by repository events, using jobs, reusable actions, secrets and OIDC to the cloud.

Intermediate · about 8 hours · difficulty 2/5

Learn first: [Continuous Integration and Delivery](https://www.internhack.in/roadmaps/tracks/devops/ci-cd-concepts)

**GitHub Actions** is built into GitHub, free for public repositories and generous for private ones, which makes it the easiest first CI system to learn.

### Building blocks

- **Workflows** are YAML files in `.github/workflows/`, triggered by events such as `push`, `pull_request`, `schedule`, `workflow_dispatch` or `release`.
- **Jobs** run on **runners** (GitHub-hosted Linux, Windows or macOS, or self-hosted) and run in parallel unless linked with `needs`.
- **Steps** either `run` shell commands or `uses` an **action** from the marketplace, such as `actions/checkout` and `actions/setup-node`.
- A **matrix** fans a job out across versions or operating systems.
- **Caching** (`actions/cache` or built-in setup caches) and **artifacts** pass files between jobs.

### Secrets and cloud access

Store credentials as **secrets** and read them with `${{ secrets.NAME }}`. Better still, use **OIDC**: the workflow requests a short-lived token and assumes a cloud role, so no long-lived keys exist at all. Scope the default `GITHUB_TOKEN` with `permissions:`.

### Deployments

**Environments** add required reviewers, wait timers and environment-specific secrets. **Concurrency groups** stop two deploys of the same environment running together.

### Reuse and hardening

- **Reusable workflows** (`workflow_call`) and **composite actions** remove copy-paste across repos.
- Pin third-party actions to a full commit SHA.
- Be careful with `pull_request_target` and untrusted input in scripts.

**Good enough to move on:** you can write a workflow that lints, tests across a matrix, builds and pushes an image, and deploys to a protected environment using OIDC with no stored cloud keys.

## Key concepts

- **Workflows, events and triggers**
- **Jobs, steps and runners**
- **Marketplace actions**
- **Matrix builds**
- **Caching and artifacts**
- **Secrets and OIDC to cloud**
- **Environments and approvals**
- **Reusable workflows and composite actions**
- **Self-hosted runners**

## Other options for this step

- [GitLab CI/CD](https://www.internhack.in/roadmaps/tracks/devops/gitlab-ci): Pipelines defined in .gitlab-ci.yml with stages, jobs, runners and environments, tightly integrated with GitLab's registry and security tools.
- [Jenkins](https://www.internhack.in/roadmaps/tracks/devops/jenkins): The long-standing self-hosted automation server, with pipelines as code in Jenkinsfiles and a huge plugin ecosystem.

## Mini project

Create a workflow for a containerised app: test on pull requests, build and push to a registry on main tagged with the commit SHA, then deploy to a staging environment and, after manual approval, to production using OIDC.

## Check yourself

What does OIDC federation remove from your repository settings, and why is that a security win?

## Free resources

- [GitHub Actions documentation](https://docs.github.com/en/actions) (GitHub)
- [Security hardening for GitHub Actions](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions) (GitHub)

Previous: [Continuous Integration and Delivery](https://www.internhack.in/roadmaps/tracks/devops/ci-cd-concepts) · Next: [GitLab CI/CD](https://www.internhack.in/roadmaps/tracks/devops/gitlab-ci)

## More in CI/CD Pipelines and Release Strategies

- [Continuous Integration and Delivery](https://www.internhack.in/roadmaps/tracks/devops/ci-cd-concepts)
- [GitHub Actions](https://www.internhack.in/roadmaps/tracks/devops/github-actions)
- [GitLab CI/CD](https://www.internhack.in/roadmaps/tracks/devops/gitlab-ci)
- [Jenkins](https://www.internhack.in/roadmaps/tracks/devops/jenkins)
- [Artifact and Package Management](https://www.internhack.in/roadmaps/tracks/devops/artifact-management)
- [Deployment Strategies and Feature Flags](https://www.internhack.in/roadmaps/tracks/devops/deployment-strategies)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
