Skip to content
IT glossary
DevOps and cloudUpdated December 3, 2026

GitHub Actions

A GitHub service that runs tasks automatically when repository events occur. For example, it can run tests on a pull request and report whether they passed.

What it does

GitHub Actions runs the commands a team would otherwise have to run by hand to check, build, or deploy a project. A common setup runs tests on pull requests, builds an image after changes reach main, and publishes it when the team cuts a release. Not every workflow is a CI/CD pipeline: you can also run scheduled maintenance or start a task manually. GitLab CI and Jenkins serve similar purposes, but they are separate tools with different configuration and execution models.

From an event to a runner

A workflow is a YAML file in .github/workflows/. Its on field tells GitHub when to start a run. Its jobs section describes what runs. Each job is assigned to a runner, the machine that executes it. A GitHub-hosted runner saves you from managing that machine; a self-hosted runner can provide access to an internal network or specialized hardware, but you maintain its environment.

A job runs its steps in order. A step can execute a shell command with run or call a reusable action with uses. Jobs without dependencies can run in parallel when runners are available. To make a job wait for another one, declare a dependency with needs.

Example: a pull request check

name: Tests
on: [pull_request]
permissions:
  contents: read
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
      - run: npm ci
      - run: npm test

For this example, the Node.js repository needs a package-lock.json file and a test script in package.json. Checkout puts the source files on the runner, npm ci installs the locked dependencies, and npm test runs the test script. If that command exits with a nonzero status, the job fails and GitHub reports the result on the pull request. Reporting a failure and blocking a merge are different: to block a merge, configure the check as required on the target branch.

Common mistakes and interview questions

Suppose a build job creates a package and a deploy job declares needs: build. That ensures the build finishes successfully before deployment starts by default, but it does not put the package on the deploy runner. Upload the package as an artifact in the build job and download it in the deploy job. A cache has a different purpose: it speeds up later runs, for example by reusing downloaded dependencies.

An interviewer may ask how you would separate pull request checks from production deployments. Explain what triggers each workflow, which checks must pass, and where credentials are needed. A test job that only checks out code and runs tests needs no deployment credentials. Keep those credentials scoped to the deployment environment and grant the workflow token only the permissions its jobs need.