Collaboration & GitHub · 8 min read · Beginner
GitHub Actions & Automated CI/CD
Automate tests, builds, and deployments on every push and Pull Request using .github/workflows YAML files.
What you'll learn
- Understand triggers (on: push, pull_request), jobs, and steps in GitHub Actions
- Run automated build and test checks on every Pull Request
- Use GitHub Secrets safely for deployment credentials
GitHub Actions runs automated workflows whenever events happen in your repository (such as pushing to main or opening a Pull Request). Workflows live in .github/workflows/*.yml.
Anatomy of a CI Workflow
on:defines triggers (push,pull_request).jobs:defines isolated virtual machines (runs-on: ubuntu-latest).steps:runs actions (actions/checkout@v4) and shell commands (npm ci && npm test).
Fill-in-the-Blank Exercise
GitHub Actions Trigger & Runner
Trigger CI on pushes to main and run on the latest Ubuntu runner.
on:
:
branches: [main]
jobs:
build:
runs-on: Interactive Git Sandbox
GitCommit a CI Workflow
main
(main) $ git status
On branch main Untracked files: index.html, styles.css
Check Your Understanding
Score: 0 / 1
1. Where must GitHub Actions workflow YAML files be stored in a repository?
Study Workspace
Finished this lesson?
Your progress is saved locally in your browser, no account needed.