โ† Back to blog

Your first CI/CD pipeline with GitHub Actions, in plain English

Building a first CI/CD pipeline with GitHub Actions

GitHub Actions runs automated tasks (a workflow) whenever something happens in your repository, like a push. A basic pipeline checks out your code, runs your tests, and if they pass, deploys. You define it in a single YAML file in your repo. For small projects it is free, and it removes the risk and tedium of manual deployment.

Deploying by hand, copying files to a server, hoping you did not forget a step, is slow and dangerous. CI/CD automates it: every time you push, your code is tested and shipped automatically. GitHub Actions is the easiest place to start, because it lives right inside the GitHub you already use.

What CI/CD means

CI (Continuous Integration) means automatically testing your code every time it changes, so bugs are caught early. CD (Continuous Delivery/Deployment) means automatically shipping that tested code to your server or app store.

Together, CI/CD turns 'deploy day' from a stressful event into a routine that happens safely on every push. The goal is small, frequent, reliable releases instead of rare, risky ones.

How GitHub Actions is structured

A workflow is an automated process defined in a YAML file inside your repo (in .github/workflows/). It is triggered by an event (like a push). It contains jobs, and each job runs a series of steps on a fresh virtual machine GitHub provides.

Steps can run commands or reuse pre-built actions from the community, for example, an action that sets up Node.js, or one that deploys to a server. You assemble these like building blocks.

What a first pipeline does

A minimal pipeline for a web app has three logical stages: check out the code, install dependencies and run the tests, and, if the tests pass, deploy. Each is a few lines in the YAML file.

The key behaviour: if the tests fail, the pipeline stops and nothing is deployed. Broken code never reaches your users automatically, which is exactly the safety you want.

Secrets and safety

Your pipeline often needs credentials, a server password, an API key, to deploy. Never put these in the YAML file. GitHub provides encrypted secrets: you store them securely in the repo settings and reference them by name in the workflow.

This keeps credentials out of your code history while still letting automation use them. Treat it as a hard rule: secrets go in GitHub Secrets, never in the workflow file.

Starting simple and growing

Begin with just CI: run your tests on every push. That alone catches bugs before they spread and is valuable immediately. Once that is reliable, add deployment as a second stage.

GitHub Actions is free for public repositories and includes a generous free allowance for private ones, enough for most small and early-stage projects. Start with one simple workflow and expand it as your needs grow, not before.

Key takeaways

  • CI automatically tests your code on every change; CD automatically ships the tested code, together they make releases safe and routine.
  • GitHub Actions workflows are YAML files triggered by events, containing jobs and steps that run on fresh virtual machines.
  • A first pipeline checks out code, runs tests, and deploys only if tests pass, broken code never auto-deploys.
  • Store credentials in encrypted GitHub Secrets, never in the workflow file; start with CI only and add deployment later.

Frequently asked questions

Q: Is GitHub Actions free?

It is free for public repositories. Private repositories get a monthly free allowance of build minutes, which is enough for most small and early-stage projects. You only pay if you exceed that allowance with heavy usage.

Q: Do I need to know a special language?

Workflows are written in YAML, a simple, readable configuration format, not a programming language. You describe what should happen in steps. Many steps reuse community-built actions, so you often assemble a pipeline more than you write one from scratch.

Q: What if I am not using GitHub?

The same concepts apply with GitLab CI/CD, Bitbucket Pipelines, or standalone tools like Jenkins. The ideas, workflows triggered by events, testing before deploying, storing secrets securely, transfer directly. GitHub Actions is just the most accessible starting point for many teams.

Sources

  1. GitHub Docs, 2026. "GitHub Actions documentation."
  2. GitHub Docs, 2026. "Understanding GitHub Actions."
  3. GitHub Docs, 2026. "Encrypted secrets."

Want automated testing and deployment set up for your project? Kaevor builds CI/CD pipelines for African teams, no more manual, risky deploys. Message us on WhatsApp.

Chat on WhatsApp โ†’