GitHub Actions – Automate Your Workflow
GitHub Actions helps you automate, customize, and execute your software development workflows directly in your repository.
Module Overview
▶
Learn what GitHub Actions is, its core concepts (workflows, jobs, steps, and runners), and how it fits into CI/CD pipelines.
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
Getting Started
▶
Set up your first workflow file, understand YAML syntax, and trigger actions on push events.
name: Hello World
on: push
jobs:
greet:
runs-on: ubuntu-latest
steps:
- run: echo "Hello, GitHub Actions!"
Advanced Workflow Syntax
▶
Utilize matrix builds, secrets, caching, and conditional execution to power complex pipelines.
strategy:
matrix:
node-version: [12, 14, 16]
steps:
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
Best Practices
▶
- Keep workflows fast and atomic.
- Store secrets securely.
- Leverage reusable workflows.
- Use caching wisely.
Quick Quiz
What file extension is used for GitHub Actions workflow files?