Back to devops
devops#github-actions#ci-cd#devops

GitHub Actions: Your First CI Workflow

Set up automated tests on every push in under 10 minutes with a single YAML file.

Jane Contributor August 2, 2026 1 views

GitHub Actions in 10 Minutes

GitHub Actions is a free CI/CD system built into GitHub. Every time you push, it can automatically:

  • run your tests,
  • build your Docker image,
  • deploy to production.

Anatomy of a workflow

Place this file in your repo at .github/workflows/ci.yml:

name: CI

on:                        # when to run
  push: { branches: [main] }
  pull_request:

jobs:
  test:                    # a job is a set of steps that run on one machine
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20, cache: yarn }
      - run: yarn install --frozen-lockfile
      - run: yarn lint
      - run: yarn test --coverage

The four building blocks

WordMeaning
WorkflowThe whole YAML file.
JobA group of steps on one machine (runs-on).
StepA single command or a pre-built uses: action.
RunnerThe virtual machine that runs the job.

Adding secrets

Go to Repo → Settings → Secrets and variables → Actions and add AWS_ACCESS_KEY_ID. Use it as:

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

Beginner tips

  • Cache dependencies with actions/setup-node's cache: yarn — huge speed win.
  • Split slow jobs into matrix builds to run Node 18, 20, 22 in parallel.
  • Use the Marketplace — someone probably wrote the action you need.

Real-world example

Push code → tests run in 2 minutes → if green, a second job builds a Docker image and pushes to ECR → a third job deploys to staging. All from one file, all free (for public repos).

Keep reading

You may also like

Discussion (0)

No comments yet. Be the first to weigh in.

Leave a comment

Comments are reviewed before appearing.