Script Valley
Git and GitHub Complete Course: From Beginner to Advanced
GitHub Actions and CI/CD AutomationLesson 5.1

Introduction to GitHub Actions

GitHub Actions, workflow, job, step, runner, YAML syntax, workflow file location, events

Introduction to GitHub Actions

GitHub Actions is a CI/CD and automation platform built directly into GitHub. It allows you to automate your build, test, and deployment pipeline by writing workflows in YAML files stored in your repository. When events like push, pull request, or a scheduled timer occur, GitHub automatically runs the workflows you define.

DiagramGitHub Actions Core Concepts

IMAGE PROMPT (replace this block with your generated image):

Flat nested hierarchy diagram on white background. Title: GitHub Actions: Workflows, Jobs, and Steps. One large outer box labeled Workflow (.github/workflows/ci.yml) with a light #3A5EFF background (#e8ecff) and solid #3A5EFF border. Inside: a trigger banner at top labeled Triggered by: on: [push, pull_request] (gray pill). Inside: two Job boxes side by side. Job 1 box (medium #3A5EFF fill): labeled Job: test — runs-on: ubuntu-latest. Inside Job 1: four Step rows (white fill cards): Step 1: actions/checkout@v4 (uses icon). Step 2: actions/setup-node@v4 (uses icon). Step 3: npm ci (run icon). Step 4: npm test (run icon). Job 2 box (medium #3A5EFF fill): labeled Job: deploy — needs: test. Inside Job 2: two Step rows: Step 1: Build Docker image. Step 2: Push and deploy. Arrow between Job 1 and Job 2 labeled needs: waits for test to pass. Right sidebar: event trigger pills stacked — push, pull_request, schedule (cron), workflow_dispatch. White background, clean nesting visual.

Core Concepts

A workflow is an automated process defined in a YAML file. Workflows live in the .github/workflows/ directory of your repository. Each workflow contains one or more jobs. A job is a group of steps that runs on the same machine (called a runner). Steps are individual tasks within a job — they can run shell commands or use pre-built actions from the GitHub Marketplace.

A Simple Workflow

name: Hello World

on: [push]

jobs:
  greet:
    runs-on: ubuntu-latest
    steps:
      - name: Print hello
        run: echo "Hello, GitHub Actions!"

This workflow runs on every push to any branch. The job runs on a fresh Ubuntu virtual machine and executes a single shell command.

Trigger Events

Workflows are triggered by events. Common events include push, pull_request, schedule (cron), workflow_dispatch (manual trigger), and release. You can filter events by branch, tag, or file path changes.

Up next

Writing CI Workflows: Lint and Test

Sign in to track progress