GitHub Actions is the CI/CD tool most DevOps engineers meet first in 2026, and for good reason: it lives inside GitHub, where the code already is, it is configured in YAML files stored in the repository, and it is free for public repositories and for a generous monthly allowance on private ones.
This is a shortened version of the full tutorial on DevOps Job Updates. It builds a real pipeline from scratch — one that tests a Node.js application, builds a Docker image and pushes it to a registry — and explains each concept as it appears. You need a GitHub account and a repository with some code in it.
How GitHub Actions Works
- Workflow — an automated process, defined by a YAML file in .github/workflows/.
- Event (trigger) — what starts a workflow: a push, a pull request, a schedule, a manual button, or a release being published.
- Job — a set of steps that run on the same runner. Jobs run in parallel by default; you make one job depend on another with needs.
- Step — a single task inside a job: either a shell command (run:) or a reusable action (uses:).
- Runner — the machine a job runs on. GitHub-hosted runners are fresh virtual machines discarded after the job; self-hosted runners are machines you provide.
Your First Workflow: Test on Every Push
Create .github/workflows/ci.yml: name CI; on push and pull_request to branches main; job test runs-on ubuntu-latest with steps: checkout code (actions/checkout@v4), set up Node.js 22 with npm cache (actions/setup-node@v4), install dependencies (npm ci), run tests (npm test), lint (npm run lint).
Commit and push. Open the Actions tab in GitHub and watch the run. Pin actions to a major version (@v4), not to a branch; cache: npm caches dependencies between runs; npm ci installs exactly what package-lock.json specifies.
Adding a Build Job and a Docker Push
Add a second job build-and-push that needs test, runs-on ubuntu-latest, permissions contents read and packages write, with steps: checkout (actions/checkout@v4), log in to GitHub Container Registry ghcr.io with docker/login-action@v3 using github.actor and secrets.GITHUB_TOKEN, build and push image with docker/build-push-action@v6, context ., push true, tags ghcr.io/${{ github.repository }}:latest.
GITHUB_TOKEN is a token GitHub creates automatically for each run. Warning: :latest is convenient for a tutorial and dangerous in production — tag images with the commit SHA.
Secrets and Deploying Safely
Real pipelines need credentials. GitHub stores them as secrets — encrypted values injected into a run as environment variables and never printed in logs. Add one under Settings → Secrets and variables → Actions, then reference it as ${{ secrets.NAME }}. Never commit a real credential to a repository.
Common Beginner Mistakes
- Running everything in one giant job instead of splitting test, build and deploy.
- No needs: between jobs, so a broken build gets deployed.
- Secrets committed to the repository or printed in logs.
- Using :latest image tags in production.
- Pinning actions to a branch instead of a major version.
Pricing note: standard GitHub-hosted runners are free on public repositories. On private repositories each account gets a monthly allowance of included compute ($12 on GitHub Free, $18 on Pro and Team, $300 on Enterprise Cloud), after which usage is billed per minute. Since 28 October 2026 GitHub expresses that allowance as a dollar amount rather than a minute count.
Closing line: This is a shortened version of the full tutorial. Read the complete guide, with the full pipeline, secrets and environments, reusable workflows, caching, and the GitHub Actions vs Jenkins comparison, on DevOps Job Updates: https://devopsjobupdates.com/github-actions-tutorial/
Top comments (0)