GitHub Actions Tutorial: Your First CI Workflow, Step by Step (2026)

GitHub Actions Tutorial: Your First CI Workflow, Step by Step (2026)

This GitHub Actions tutorial shows you how to build a workflow in a single YAML file that tests your code on every push, runs on several Node versions at once, caches dependencies, uses secrets safely and stores a result at the end. GitHub Actions is GitHub’s built-in automation: you describe when something should happen and what should happen, and GitHub hands you a fresh virtual machine to do it. No server of your own, no Jenkins, nothing to install.

We did not copy this from the documentation. On 16 November 2026 we created a private throwaway repository, ran exactly the workflows from this article in it, provoked errors on purpose and wrote everything down. Afterwards we deleted the repo. Five findings up front:

1. A single colon followed by a space in the wrong place in a run: line makes the entire workflow fail in 0 seconds. All GitHub says is “This run likely failed because of a workflow file issue”. The tool actionlint pointed us to the exact line and column immediately.

2. GitHub reliably masks secrets in the log, even in Base64. Reversed, or with spaces between the characters, our test secret showed up in plain text.

3. A secret that does not exist causes no error at all. The value is simply empty, length 0. The workflow carries on as if everything were fine.

4. Many guides still use actions/checkout@v4. On today’s runners that produces a warning, because this version targets Node.js 20, which GitHub now forces onto Node 24. The current versions are checkout v7 and setup-node v7.

5. The default runner ubuntu-latest was Ubuntu 26.04.1 LTS with 2 CPU cores, about 7.7 GB of RAM and 15 GB of free disk space for us. The complete first run across three Node versions took 14 seconds.

Glowing blue conveyor belts carry luminous cubes through a digital network against a dark background

What is GitHub Actions? The terms used in this tutorial

Before we write the first file, it is worth looking at the five terms that come up in every GitHub Actions tutorial. Once you can tell them apart, you can read other people’s workflows at a glance.

Workflow. A YAML file in the .github/workflows/ folder of your repository. Every file there is a separate workflow. The file name does not matter as long as it ends in .yml or .yaml. If YAML is new to you: we measured its differences and traps in detail in YAML vs JSON. With GitHub Actions they matter a lot, as finding 1 shows.

Event (trigger). The event that starts the workflow. The most common ones are push (someone pushes commits), pull_request (a pull request is opened or updated), schedule (a timetable in cron format) and workflow_dispatch (manual start via a button or the API).

Job. A group of steps that runs on one machine. A workflow can have several jobs. Unless you say otherwise, they run in parallel, each on its own fresh machine. With needs: you define an order.

Step. A single step within a job. Either a shell command (run:) or a ready-made, reusable action (uses:). Steps of the same job share a file system; jobs do not.

Runner. The machine a job runs on. GitHub provides runners with Linux, Windows and macOS (runs-on: ubuntu-latest). You can also register your own machines as self-hosted runners.

The principle behind it is called continuous integration (CI): every change is built and tested automatically before it reaches the main branch. Add automatic shipping and you get continuous delivery or continuous deployment (CD). GitHub Actions does both. The foundation is always a Git repository. If you want to brush up on the commands around it, see our Git commands list; the basic idea is in What is Git?.

“GitHub Actions Explained: Everything You Need to Know” by DevOps with Flavius (September 2026) walks through a workflow file line by line. Ideal if you have been copying YAML from other repos without understanding every line.

Our test setup for this GitHub Actions tutorial

So that the numbers in this article can be checked, here is the exact setup:

  • Repository: newly created, private, only for this test, deleted afterwards.
  • Project: a tiny Node.js package with a function sum(a, b) and one test using the built-in test runner (node --test). No frameworks, so the measurement shows what GitHub Actions costs, not what a large project costs.
  • Runner: ubuntu-latest, the free standard runner.
  • Measured: durations from the GitHub API (startedAt/completedAt per job), runner data via nproc, free -m, df -h and /etc/os-release directly inside the workflow, log contents via gh run view --log.
  • Date: 16 Nov 2026, runner version 2.338.2, runner image ubuntu-26.04, version 20261111.196.1.

By the way, our new repository had the default default_workflow_permissions: read. That means the automatic token every workflow receives can only read out of the box. Older repositories may be configured differently. More on that below.

Step 1: The first workflow file

Create the file .github/workflows/ci.yml in your repository. This is the smallest sensible workflow we recommend:

name: CI

on:
  push:
    branches: [main]
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 22
          cache: npm
      - run: npm ci
      - run: npm test

Line by line:

  • name: CI is the display name in the Actions tab.
  • on: defines when the workflow starts. Here: on pushes to main, on every pull request and manually via the “Run workflow” button.
  • permissions: contents: read restricts the automatic token to read access. We always write this explicitly, even when the repo is already configured that way. Then it stays correct when someone copies the file into another repo.
  • runs-on: ubuntu-latest picks the runner.
  • timeout-minutes: 10 cancels a hanging job after ten minutes. Without this line the default limit of 360 minutes applies. A test waiting for a network reply that never comes would otherwise burn six hours of compute.
  • actions/checkout@v7 fetches your code onto the runner. Without this step the working directory is empty, a very common beginner mistake.
  • actions/setup-node@v7 installs the requested Node version and, with cache: npm, takes care of caching.
  • npm ci installs dependencies exactly according to package-lock.json. Unlike npm install, it never changes the lock file and aborts if it does not match package.json. That is exactly what you want in CI.

Commit and push the file. A new run appears immediately in the Actions tab of your repository. You can also follow it in the terminal if you have the GitHub CLI installed:

gh run list
gh run watch
gh run view --log

Abstract network of glowing, connected nodes and pipes in blue and violet tones

Which action version is current?

Many tutorials, even new ones, still show actions/checkout@v4 and actions/setup-node@v4. That works, but on today’s runners it produces this warning, which we got in every job of our first run:

##[warning]Node.js 20 is deprecated. The following actions target Node.js 20
but are being forced to run on Node.js 24: actions/checkout@v4, ...

The actions themselves are JavaScript programs that run on a specific Node version. The old major versions were built for Node 20. GitHub now runs them on Node 24 anyway; it usually works, but it is not guaranteed. On the day of our measurement, the GitHub API listed these as the latest versions:

ActionLatest versionReleased
actions/checkoutv7.0.120 Jul 2026
actions/setup-nodev7.1.08 Oct 2026
actions/upload-artifactv7.0.27 Oct 2026
actions/cachev6.1.026 Jun 2026

This table will age, of course. You can check it yourself at any time: gh api repos/actions/checkout/releases/latest -q .tag_name. Or let updates be proposed automatically; see the Dependabot section below.

Step 2: What actually happens on the runner

We wanted to know what kind of machine you actually get with ubuntu-latest. So we added a step that prints exactly that:

      - name: Runner info
        run: |
          nproc
          free -m | head -2
          df -h / | tail -1
          uname -r
          grep PRETTY /etc/os-release

The result, identical on all three machines started in parallel:

MetricResult
Operating systemUbuntu 26.04.1 LTS
Kernel7.0.0-1019-azure
CPU cores (nproc)2
Memory7,931 MB total, about 6,900 MB available
System disk72 GB, of which 15 GB free
CloudAzure

Two things stand out. First: ubuntu-latest moves. If you rely on a specific Ubuntu version, pin it, for example runs-on: ubuntu-24.04. Otherwise a workflow that ran fine for months can suddenly run with new package versions one Monday. Second: 15 GB free sounds like a lot, but it disappears fast if you build large Docker images or download models. How to keep images small is covered in What is Docker? and in the practical part of Docker Compose example.

Important for understanding: every job gets a brand-new machine. After the job it is thrown away. Nothing you install or store there is still around for the next run, unless you deliberately use cache or artifacts.

Step 3: Matrix builds, testing several versions at once

One of the most powerful features of GitHub Actions is the matrix. Instead of writing a job three times, you describe the variants:

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    strategy:
      fail-fast: false
      matrix:
        node: [20, 22, 24]
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: ${{ matrix.node }}
          cache: npm
      - run: npm ci
      - run: npm test

GitHub turns this into three jobs: test (20), test (22) and test (24). They start at the same time. Our very first run looked like this:

JobStartEndDuration
test (20)08:03:0708:03:1811 s
test (22)08:03:0708:03:147 s
test (24)08:03:0708:03:169 s

The overview listed the whole workflow at 14 seconds. Three Node versions in the time it takes to type npm install locally.

You can combine matrix dimensions too, for example os: [ubuntu-latest, windows-latest] and node: [22, 24]. That creates 2 × 2 = 4 jobs. In private repositories each of them counts against your quota, and Windows and macOS runners are billed at a higher rate than Linux. So only use as many combinations as you need.

Three silver server racks with glowing green status lights stand side by side in a bright room

fail-fast: what happens when one variant fails?

fail-fast defaults to true. That means: if one matrix job fails, GitHub cancels the others. That saves compute but costs you information. We tested this twice, with a test that deliberately fails only on Node 20.

Attempt 1, all jobs fast: Node 20 failed, but Node 22 and 24 had already finished at that point and stayed green. There was nothing left to cancel.

Attempt 2, Node 22 and 24 artificially slowed by 25 seconds: Node 20 failed at 08:09:34. Node 22 and 24 were stopped shortly afterwards with status cancelled. A third job that depended on the tests via needs: was skipped.

The consequence: with fail-fast: true, after a red run you do not know whether only Node 20 is affected or all versions. That is why we almost always set fail-fast: false for matrix tests. For expensive builds that would all fail on the same error anyway, true makes sense.

Step 4: Caching, so not every run downloads everything again

Every run starts on an empty runner. Without a cache, npm ci downloads all packages from the network each time. actions/setup-node with cache: npm stores the npm cache directory between runs, keyed on the lock file.

Our log shows exactly how this works. In the very first run, the Node 24 job reported:

npm cache is not found
...
Cache saved with the key: node-cache-Linux-x64-npm-ecfe7b8f...

The Node 20 job, which reached the same point a few seconds later, already got:

Cache hit for: node-cache-Linux-x64-npm-ecfe7b8f...
Cache Size: ~0 MB (356579 B)
Cache restored successfully

Two takeaways. First: the cache is shared between parallel jobs within the same run as soon as the first one has saved it. Second: for our tiny project the cache was only 357 KB. Here it saves practically no time. Real projects with hundreds of megabytes of dependencies are a different story.

What you should know:

  • The key contains a hash of the lock file. When package-lock.json changes, you get a new cache.
  • A cache is not overwritten if the key already exists. The log then says: “Cache hit occurred on the primary key …, not saving cache.”
  • According to the GitHub documentation, every repository has its own cache allowance of 10 GB, separate from artifacts and packages. Old entries are evicted.
  • The cache is not a place for build output you need later. That is what artifacts are for.

Step 5: Using secrets correctly

Sooner or later your workflow needs a password, an API key or an SSH key, for a deploy, for example. That never belongs in the YAML file, but in the repository’s secrets: Settings → Secrets and variables → Actions → New repository secret. Or in the terminal:

gh secret set DEPLOY_KEY < ~/.ssh/deploy_key

In the workflow you access it, ideally via an environment variable:

      - name: Do something with the secret
        env:
          MY_SECRET: ${{ secrets.DEMO_SECRET }}
        run: ./scripts/deploy.sh

GitHub promises to mask secrets in the log automatically. We wanted to know how far that goes. So we created an 18-character test secret and deliberately printed it in different ways:

      - name: Masking limits
        env:
          MY_SECRET: ${{ secrets.DEMO_SECRET }}
        run: |
          echo "direct: $MY_SECRET"
          echo "base64: $(echo -n "$MY_SECRET" | base64)"
          echo "reversed: $(echo -n "$MY_SECRET" | rev)"
          echo "spaced: $(echo -n "$MY_SECRET" | sed 's/./& /g')"

The log showed (labels translated from our German test run):

direct: ***
base64: ***
reversed: frewgew-321-mieheg
spaced: g e h e i m - 1 2 3 - w e g w e r f

The Base64 variant was recognised and masked, which pleasantly surprised us. Every other transformation was not. In practice this rarely happens on purpose, but it does happen by accident: a script prints a URL with an embedded token in URL-encoded form, a tool writes a JSON dump with escaped characters, a debug mode shows substrings. Masking is a safety net, not a security concept. The actual security concept is: never print secrets, and treat logs of private repos as confidential anyway.

A digital safe with a golden padlock and key against a dark blue background with glowing points of light

The silent trap: missing secrets

Second test: we accessed a secret that does not exist (secrets.DOES_NOT_EXIST). Result:

missing: '' (length 0)

No error, no warning, the step was green. A typo in a secret name only shows up when the deploy tries to log in with an empty password and fails somewhere further down, at worst with a confusing error message. That is why we put a check right at the start of deploy jobs:

      - name: Secrets present?
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
        run: |
          if [ -z "$DEPLOY_KEY" ]; then
            echo "::error::DEPLOY_KEY is missing or empty"
            exit 1
          fi

Worth knowing: for pull requests from forks, workflows do not receive secrets, for security reasons. They are simply empty there too. With this check you immediately see why a fork PR is red.

Step 6: The GITHUB_TOKEN and its permissions

Every workflow run automatically gets a short-lived token, available as secrets.GITHUB_TOKEN or github.token. With it, the workflow can talk to your repository: check out code, write comments, create releases, depending on its permissions.

With permissions: contents: read, we tried to push a branch from inside the workflow during our test:

fatal: unable to access 'https://github.com/.../': The requested URL returned error: 403

That is exactly how it should be. Give every workflow only the permissions it needs, as late and as narrowly as possible. If a single job needs to write, for example to create a release, set the permission on that job only:

jobs:
  release:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - ...

Why this matters so much: every action you include with uses: is third-party code running with this token. If a popular action is compromised, a token with write access can modify your code. Hence the advice to pin third-party actions not just to a tag like @v3, but to a full commit hash, for example uses: owner/action@a1b2c3d…. Tags can be moved after the fact; commit hashes cannot. With the official actions/* the risk is lower, but many teams pin them too. More on the underlying principle in our article IT security vulnerabilities.

Step 7: Concurrency, so runs do not pile up

If you push several times in quick succession, you start several runs for the same branch. Usually only the latest one matters. With concurrency, a new run cancels the old one:

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

Our test: two pushes about four seconds apart. The first run was stopped after 9 seconds with status cancelled, along with all its jobs. Only the second one ran to completion.

Careful with deploy workflows: there you usually do not want to cancel a running deploy halfway. For deploys we therefore set cancel-in-progress: false. The new run then waits until the old one has finished.

Step 8: Artifacts, keeping results

If a job produces something you want to keep or need in a later job (a build folder, a test report, a package), upload it as an artifact:

      - name: Build
        run: mkdir -p out && date -u > out/build.txt
      - uses: actions/upload-artifact@v7
        with:
          name: build-output
          path: out/
          retention-days: 1

In our test the artifact was 163 bytes and, according to the API, expired exactly one day later. Without retention-days, the repository default applies, 90 days out of the box. A short value pays off, especially for private repositories: according to the GitHub documentation, artifact storage is accrued hourly, even if you delete it later.

A second job can download the artifact again with actions/download-artifact. That is the usual way to separate a build job from a deploy job: one builds, the other ships exactly that result.

The most common trap: broken YAML

Now for the finding that cost us the most time. We wanted to print a line like this in the workflow:

      - name: Missing secret
        run: echo "missing: '${{ secrets.DOES_NOT_EXIST }}'"

Looks harmless. After the push: red run, duration 0 seconds, not a single job started. The web UI and gh run view only said:

X This run likely failed because of a workflow file issue.

No line number, no hint. The cause: in YAML, a colon followed by a space (: ) starts a new mapping. In an unquoted value after run: that is not allowed. Our line contained missing: ', and that made the whole file invalid.

The tool that found the error was actionlint, a free linter built specifically for GitHub Actions files. We ran it locally via Docker:

docker run --rm -v "$PWD:/repo" -w /repo rhysd/actionlint:latest

Output:

.github/workflows/ci.yml:42:24: could not parse as YAML:
mapping values are not allowed in this context [syntax-check]

Line 42, column 24, exactly the spot. The fix is simple: use the multi-line notation with |. The content then becomes a block of text, and colons are allowed:

      - name: Missing secret
        run: |
          echo "missing: '${{ secrets.DOES_NOT_EXIST }}'"

Our rule of thumb since this test: every run: line containing more than a simple command gets |. And actionlint runs before every push, either as an editor extension or as a pre-commit hook. actionlint does not only find syntax errors, by the way, but also typos in expressions, unknown event names and typical shell mistakes through its built-in shellcheck integration.

Step 9: Deploying with GitHub Actions

A GitHub Actions tutorial without a deploy would be incomplete. The simplest way onto your own server is SSH with a dedicated deploy key. The basic pattern:

name: Deploy

on:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: deploy-production
  cancel-in-progress: false

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 24
          cache: npm
      - run: npm ci
      - run: npm test
      - run: npm run build
      - uses: actions/upload-artifact@v7
        with:
          name: dist
          path: dist/
          retention-days: 3

  deploy:
    runs-on: ubuntu-latest
    needs: test
    environment: production
    steps:
      - uses: actions/download-artifact@v7
        with:
          name: dist
          path: dist/
      - name: Secrets present?
        env:
          KEY: ${{ secrets.DEPLOY_SSH_KEY }}
        run: |
          [ -n "$KEY" ] || { echo "::error::DEPLOY_SSH_KEY missing"; exit 1; }
      - name: Copy to server
        env:
          KEY: ${{ secrets.DEPLOY_SSH_KEY }}
          HOST: ${{ secrets.DEPLOY_HOST }}
          KNOWN: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
        run: |
          install -m 700 -d ~/.ssh
          echo "$KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
          echo "$KNOWN" > ~/.ssh/known_hosts
          rsync -a --delete dist/ "deploy@$HOST:/var/www/app/"

What is in there:

  • needs: test makes sure you only ship when the tests are green.
  • environment: production links the job to an environment. In the repository settings you can store secrets there that only this job sees, and require a manual approval before it starts.
  • A dedicated key just for deploying. How to create one is explained in Generate an SSH key. On the server the key should belong to a restricted user, not root.
  • known_hosts as a secret instead of StrictHostKeyChecking=no. Otherwise you would blindly connect to any server pretending to be yours. You get the entry with ssh-keyscan your-server.com.
  • rsync --delete syncs exactly the contents of dist/. Watch the trailing slashes: dist/ copies the contents, dist copies the folder itself.

On the server, the application then runs as a systemd service, for example. How to do that is shown in Create a systemd service. If you do not want to build your own deploy path, you can put a self-hosted PaaS in between that builds on every push. Our experience with that is in our Coolify review.

A laptop resting on clouds while a rocket launches into a starry night sky beside it

Mickey Gousset shows in “Getting Started with GitHub Actions: 5 Ways to Run a GitHub Actions Workflow” (October 2026) which triggers exist and why a workflow sometimes starts and sometimes does not. It fits directly with the sections on on: and concurrency.

More triggers: schedule, manual start, path filters

Besides push and pull_request, there are a few triggers you need all the time.

Schedule. A workflow that runs every night, for dependency checks for example:

on:
  schedule:
    - cron: "17 3 * * *"

The time is always UTC. We deliberately pick an odd minute like 17, because a huge number of workflows worldwide start on the hour, and scheduled runs can then start late. A detail worth knowing: in public repositories without activity, GitHub automatically disables scheduled workflows after a while. The cron format itself is the same as on Linux, explained in Create a cron job.

Manual start with inputs. workflow_dispatch can ask for parameters:

on:
  workflow_dispatch:
    inputs:
      target:
        description: "Where to deploy?"
        type: choice
        options: [staging, production]

In the workflow you read the value with inputs.target.

Path filters. If only the docs change, the full test suite does not need to run:

on:
  push:
    branches: [main]
    paths-ignore:
      - "docs/**"
      - "**.md"

Careful in combination with branch protection rules: if a required check does not start at all because of a path filter, a pull request gets stuck at “Expected — Waiting for status”. For required checks, a job that checks briefly and then reports green is often the more robust solution.

How much does GitHub Actions cost?

The honest short version, based on GitHub’s current billing page:

  • Public repositories: standard runners are free, with no minute counter.
  • Private repositories: every plan includes a monthly amount of compute. Anything beyond that is billed to the owner of the repository, not the person who triggered the run. Linux runners are cheapest; Windows and macOS are weighted higher.
  • Storage: artifacts and GitHub Packages share a storage allowance, billed in GB-hours. The cache has a separate 10 GB per repository.
  • Self-hosted runners: do not consume the quota. You pay for your own server instead.

The exact free allowances change and depend on the plan, which is why we deliberately do not quote minute numbers here. You can look them up in the GitHub docs under “GitHub Actions billing”. In practice, for beginner projects: a small private repo with a workflow like the one in this tutorial uses a few seconds to a few minutes per run. It only gets expensive with large matrices, long builds or forgotten timeout-minutes.

Self-hosted runners: when they are worth it

A self-hosted runner is your own machine on which you install GitHub’s runner program. It then picks up jobs from your repository. This pays off if you need a lot of compute, special hardware (GPU, lots of RAM) or access to an internal network that GitHub’s machines cannot reach.

The catch is security: a self-hosted runner executes whatever code is in the workflow. In public repositories anyone can open a pull request, and depending on the configuration that code then runs on your machine. GitHub explicitly advises against using self-hosted runners with public repositories. For private repos: use a dedicated, isolated machine or VM, never a server that also holds production data, and rebuild it regularly. The basics of choosing and hardening a server are in What is a VPS? and Linux server setup.

Dependabot: keeping actions up to date automatically

Remember the Node 20 warning? To avoid it happening again, Dependabot can propose new versions of your actions automatically as pull requests. Create .github/dependabot.yml:

version: 2
updates:
  - package-ecosystem: github-actions
    directory: /
    schedule:
      interval: weekly

Dependabot finds all uses: lines and opens a pull request once a week when something new is available. Your CI workflow then tests that PR automatically. Pinned commit hashes are updated this way too, which is why hash pinning is not annoying in day-to-day work.

Our checklist for every new workflow

From the test and from our own work with workflows, these are the points we now tick off every time:

  1. Set permissions: explicitly, contents: read by default, write access only on individual jobs.
  2. timeout-minutes: on every job.
  3. Current action versions, no Node 20 warnings in the log.
  4. | for every run: line with more than a simple command.
  5. actionlint before pushing.
  6. Check that secrets exist before using them.
  7. Never print secrets, not even transformed.
  8. concurrency for CI with cancel-in-progress: true, for deploys with false.
  9. fail-fast: false for matrix tests when you want to know which variants are affected.
  10. Keep retention-days short for artifacts.
  11. Pin the runner version (ubuntu-24.04) if the build depends on it.
  12. Enable Dependabot for github-actions.

GitHub Actions tutorial FAQ

What is GitHub Actions in simple terms?

GitHub Actions is GitHub’s built-in automation. You put a YAML file in .github/workflows/ that describes which commands should run on which event (a push, for example). GitHub starts a fresh virtual machine, runs the commands and shows you the result as a green or red check mark on the commit.

Is GitHub Actions free?

For public repositories the standard runners are free. For private repositories every GitHub plan includes a monthly allowance; beyond that you are billed. Self-hosted runners do not use the allowance. Current figures are in the GitHub docs under “GitHub Actions billing”.

Where does the workflow file go?

Always in the .github/workflows/ folder at the root of your repository. Every .yml or .yaml file there is a separate workflow. If it lives anywhere else, GitHub ignores it.

Why is my workflow not starting?

The most common reasons: the file is not in .github/workflows/, the trigger does not match (for example branches: [main] while you push to master), a path filter excludes your change, or the YAML file is invalid. In the last case GitHub shows a red run lasting 0 seconds with the note “workflow file issue”. That is when actionlint helps.

What is the difference between a job and a step?

A job runs on its own machine. Several jobs run in parallel by default and do not share files. Steps are the individual steps inside a job; they run one after another and share the same file system.

How do I pass data from one job to the next?

Small values via the job’s outputs, files via artifacts: actions/upload-artifact in the first job, actions/download-artifact in the second job (with needs:).

Are secrets in GitHub Actions safe?

Secrets are stored encrypted and masked in the log. In our test they were also recognised in Base64, but not when reversed or with spaces in between. Treat masking as a safety net: never print secrets, keep the token’s permissions small, and pin third-party actions to commit hashes.

What happens if a secret does not exist?

Nothing visible. The expression simply evaluates to an empty string and the step carries on. So check at the start of critical jobs with [ -n "$VAR" ] whether the secret is set.

Which version of actions/checkout should I use?

The current major version. On 16 Nov 2026 that was actions/checkout@v7. Older versions like @v4 still work but produce a warning because they were built for Node.js 20. With Dependabot you stay current automatically.

Can I test GitHub Actions locally?

Partly. The tool act runs workflows locally in Docker containers. The environment differs from the real runner, though, and some actions behave differently. For syntax errors, actionlint is often enough. For everything else, a private test repository, like the one we used for this article, is the most reliable route.

GitHub Actions or GitLab CI, which is better?

At their core both can do the same things. If your code lives on GitHub, GitHub Actions is the obvious choice because it works without setup and the Marketplace offers a huge number of ready-made actions. GitLab CI is strong if you already use GitLab or self-host it.

How long can a job run?

By default up to 360 minutes on GitHub-hosted runners. Set a much smaller value with timeout-minutes so a hanging job does not consume your quota for hours.

Conclusion: what a good GitHub Actions tutorial should leave you with

GitHub Actions is surprisingly quick to set up. One file, one push, and 14 seconds later you have tests on three Node versions. That is exactly what makes it easy to overlook things. The traps we found in our test all come without a clear error message: broken YAML only shows a generic hint, a missing secret is simply empty, transformed secrets end up in the log in plain text, and outdated action versions keep working with a warning nobody reads.

Our recommendation for getting started: copy the workflow from step 1, set permissions and timeout-minutes, run actionlint alongside and enable Dependabot for actions. In ten minutes you will have CI that gets more right than most workflows you find in other people’s repos. Add the deploy afterwards at your own pace, with a dedicated key, known_hosts and an environment approval.