Setting up the three mandatory foundations before diving into GitHub Actions: Git and GitHub basics, the YAML format, and shell scripting. Then installing GitHub CLI and VS Code with the GitHub Actions extension so your first workflow can be written with validation directly in the editor.

Welcome to the Learn GitHub Actions series! GitHub Actions is a cloud-native CI/CD platform that lives right inside GitHub, and mastering it is one of the fastest paths toward roles like DevOps Engineer, Cloud Engineer, and Release Engineer. But before touching your first YAML workflow, there are three foundations you need to hold on to tightly: Git & GitHub basics, the YAML format, and shell scripting basics. Without these three, you will get lost in the coming episodes — because a workflow is ultimately just a YAML file that triggers shell commands inside a Git repository.
Episode 0 is the foundation layer. We will explore these three skills, then set up a complete working environment: a GitHub.com account, an authenticated GitHub CLI (gh), and VS Code with the GitHub Actions extension for validation and auto-complete when writing YAML. By the end of this episode, you will have a machine ready to write and run GitHub Actions workflows.
GitHub Actions automatically executes jobs on events that happen in your repository — from pushed commits, opened pull requests, to released releases. Because of this, understanding Git and GitHub is no longer optional, it's an absolute prerequisite.
| Concept | Explanation | Key Commands |
|---|---|---|
| Repository | Home for all files, code, and change history | git init, git clone |
| Commit | A snapshot of changes recorded permanently | git add, git commit |
| Branch | A development path separate from the main path | git branch, git checkout |
| Pull Request | Review and merge mechanism between branches | git push + GitHub UI |
git init
git add .
git commit -m "chore: inisialisasi project"
git branch feature/login
git checkout feature/login
git add .
git commit -m "feat: halaman login"
git push origin feature/loginThe most important mental model: a commit is a checkpoint you can return to at any time, and a branch is a way to develop features without breaking the main path. Pull Requests (PRs) are the heart of collaboration on GitHub — and later you will see many workflows designed specifically to run every time a PR is opened or updated. If you aren't comfortable with git add, git commit, and git push yet, take some time to read the learn-git series on this blog first.
GitHub Actions describes the entire pipeline as a YAML (YAML Ain't Markup Language) file — a human-readable data serialization format. All workflow syntax, from triggers and jobs to steps, is written in YAML. Its three basic concepts:
name: value.- in front of each item.name: my-app
version: 1.0.0
stack:
- web
- api
config:
debug: true
port: 8080
jobs:
- name: build
run: npm ciNote that hierarchy is determined by the number of spaces in front of a line, not by brackets or semicolons. Internalize this pattern well, because every part of your workflow will later depend on correct indentation depth.
Warning
YAML is extremely sensitive to indentation. Never use tabs — use spaces (the GitHub Actions convention is 2 spaces per level), and don't mix the two. A single stray tab can make the YAML parser fail with a confusing error.
Every step in GitHub Actions ultimately executes commands in a shell — by default bash with set -e and pipefail mode enabled. This means a step is considered failed if the executed command returns an exit code other than 0. The most basic pattern:
#!/bin/bash
set -e
APP_DIR="./src"
echo "Memeriksa direktori $APP_DIR"
if [ -d "$APP_DIR" ]; then
echo "Direktori ditemukan"
else
echo "Direktori tidak ada" >&2
exit 1
fiThree things you must understand from the example above: variables (values are assigned without $, used with $), branching with if for flow control, and exit codes as the success-failure language of a command. The learn-bash-scripting series on this blog is a highly recommended companion.
The first step is trivial but often forgotten: make sure you have an account at github.com. A personal account is enough to learn and use GitHub Actions features on both private and public repositories. For team scale, you can join an organization — that's where repositories, secrets, and security policies are managed centrally. Just create an account, verify your email, and your first repository is ready to be created from the New repository button.
GitHub CLI is GitHub's official command-line tool that lets you manage repositories, pull requests, and even Actions workflows without leaving your terminal. For 64-bit Ubuntu/Debian:
sudo apt-get install -y wget
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt-get update
sudo apt-get install -y gh
gh --versionmacOS users can install via Homebrew with brew install gh, and Windows users via winget install --id GitHub.cli. Once installed, the next step is authentication:
gh auth login
gh auth statusThe gh auth login command will show a series of interactive prompts: select GitHub.com as the host, select the HTTPS protocol (or SSH if you already have an SSH key), then log in through the browser — a one-time code will appear and you paste it on the github.com/login/device page. Verify the result:
$ gh version
gh version 2.62.0 (2025-03-06)
$ gh auth status
github.com
✓ Logged in to github.com as arman-dp
✓ Git operations for github.com configured to use sshIf gh auth status shows ✓ Logged in, your CLI environment is connected to GitHub. The gh commands you'll use often:
| Command | Function |
|---|---|
gh repo clone owner/repo | Clone a repository to your local machine |
gh pr create | Create a pull request directly from the terminal |
gh run list | head -5 | View the latest workflow runs |
gh workflow run deploy.yml | Trigger a workflow manually |
gh run view 123456789 | Show the detailed logs of a run |
Tip
Make a habit of using GitHub CLI to check your workflows: the combination of gh run list and gh run view --log is much faster than opening the browser every time a pipeline fails.
To write workflows comfortably, install Visual Studio Code and the GitHub Actions extension (developed by GitHub). This extension provides syntax highlighting for YAML files in the .github/workflows directory, auto-complete for keywords like event triggers and popular action names, plus real-time YAML validation — indentation errors will be visible before the workflow is even pushed.
To install it: open VS Code, press Ctrl+Shift+X to open the Extensions panel, search for "GitHub Actions", then click Install. Once installed, every file named *.yml or *.yaml inside the .github/workflows folder will be automatically detected and given a special icon.
gh repo list will display To get started with GitHub CLI, please run: gh auth login. The fix is to run gh auth login..yml and .yaml extensions are supported, as long as the file is inside the .github/workflows/ directory.In episode 0 you have prepared a complete foundation for learning GitHub Actions:
commit, branch, pull request), the YAML format (key-value, list, nesting), and bash basics (set -e, variables, exit codes).gh), complete with gh --version and gh auth status.Your environment is now ready. In episode 1 we'll pause from typing to understand the history, CI/CD concepts, and why GitHub Actions is worth choosing — starting from the definitions of Continuous Integration and Continuous Delivery, the evolution from self-hosted Jenkins to cloud-native tools, to an honest comparison between Jenkins, GitHub Actions, and GitLab CI. See you in episode 1!