CI/CD with GitHub Actions Tutorial 138 lessons · 2:41:13+ of video
CI/CD with GitHub Actions Home What Is CI/CD?
What Is CI/CD? Life Without CI Integration, Delivery, Deployment Pipelines and Our Project
What Is a Pipeline? Our Project Running Tests by Hand Git and GitHub
Git in Two Minutes Branches and Pull Requests Where GitHub Actions Fits Key Words and YAML
The Key Words YAML Basics YAML Lists and Maps YAML Gotchas
YAML Gotchas Multi-line Strings Foundations Quiz Your First Workflow
Your First Workflow The Workflows Folder Reading a Workflow Events, Jobs and Steps
Events with on Jobs and runs-on Steps with run Actions
Actions with uses checkout setup-python Tests in CI
Running Tests in CI Reading the Logs A Failing Build Fixing and Triggers
Fixing the Build Checking Workflows Push and Pull Request Triggers Filters, Manual and Scheduled Runs
Branch and Path Filters Manual Runs Scheduled Runs First Workflows Practice
Practice: A Lint Workflow Practice: Two Triggers First Workflows Quiz Variables and Contexts
Environment Variables Contexts and Expressions Default Variables Secrets, Tokens and Outputs
Secrets GITHUB_TOKEN and Permissions Step Outputs Jobs and needs
Multiple Jobs needs Job Outputs Conditions and Matrices
Conditions with if Status Functions Matrix Builds Matrix Options and Caching
Matrix include and exclude fail-fast Caching Dependencies Artifacts, Services and Timeouts
Artifacts Service Containers Timeouts and continue-on-error Concurrency and Practice
Concurrency Working Directory and Shell Practice: A Matrix Pipeline Building Blocks Practice
Practice: Build Then Test Practice: Debugging a Pipeline Building Blocks Quiz Quality Gates
Linting Formatting Checks Test Coverage Fast Feedback and Node.js
Fast Feedback A Node.js Pipeline npm ci and Lockfiles Security Checks
Dependency Scanning Dependabot Secret Scanning Protecting main
Branch Protection Required Checks Status Badges Reviews, Flaky Tests, and Gates
Code Review with CI Flaky Tests Practice: A Quality Gate Fixing Builds and the Test Pyramid
Practice: Fix the Red Build The Test Pyramid Quality Quiz Continuous Delivery
Continuous Delivery Building a Docker Image Image Tags Versions and Releases
Versions and Git Tags Pushing to a Registry Releases on Tags Environments and Approvals
Environments Approvals Environment Secrets Deployment Strategies
Deployment Strategies Rolling Deploys Blue-Green and Canary Deploying
Deploying over SSH GitHub Pages Cloud Login with OIDC Smoke Tests, Rollbacks, and Flags
Smoke Tests Rollbacks Feature Flags Migrations and Delivery Practice
Database Migrations Practice: Deploy on Tag Practice: Staging then Production Delivery Quiz and Reusable Workflows
Delivery Quiz Reusable Workflows Inputs and Secrets for Reusable Workflows Writing Your Own Actions
Composite Actions Writing a Script Action Marketplace Actions Workflow Security
Pinning Actions Script Injection pull_request_target Dangers Privilege, Runners, and Monorepos
Least Privilege Self-Hosted Runners Monorepos Debugging, Speed, and Cost
Debugging Workflows Speeding Up Pipelines Cost and Minutes Templates and Shared Workflows
Workflow Templates Practice: A Shared Workflow Advanced Quiz Projects: CI and Delivery
Project: Python CI Project: Node CI Project: Docker Delivery Projects: Releases and the Full Pipeline
Project: Release Automation Project: Nightly Checks Project: The Full Pipeline Beyond Actions and Best Practices
Other CI Tools CI/CD Best Practices Common Mistakes Interview Questions
Interview Question 1 Interview Question 2 Interview Question 3 Cheat Sheets and Final Quiz
Cheat Sheet: Workflow Syntax Cheat Sheet: Patterns Final Quiz Metrics and Next Steps
DevOps Metrics What to Learn Next Practice Plan Your First Pipeline and Course Complete
Your First Real Pipeline Course Review Course Complete CI/CD with GitHub Actions · Lesson 98 of 138
Practice: Deploy on Tag Test, then ship.
⏱ 2 min read ▶ Video at 1:53:12 🎓 Free
▶ starts at 1:53:12 Practice time. Write a workflow that runs when a version tag is pushed. It should run the tests first, and deploy to production only if they pass. Pause, and try it.
From the video: Practice: Deploy on Tag Runs on a version tag Test first Then deploy The workflow listens for tags starting with v. The test job installs the requirements and runs pytest. The deploy job needs test, uses the production environment, and deploys the version from github dot ref name.
.github/workflows/deploy.yml yaml Copy
name : Deploy on tag
on :
push :
tags : [ "v*" ]
jobs :
test :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v4
- run : pip install -q -r requirements.txt && pytest -q
deploy :
needs : test
runs-on : ubuntu-latest
environment : production
steps :
- run : echo "Deploying ${{ github.ref_name }}" Our helper pretends the tag v two point zero point zero was pushed. The tests pass, so the deploy job runs, in the production environment, and deploys v two point zero point zero.
Terminal Copy commands
run-steps .github/workflows/deploy.yml --tag v2.0.0 | grep -vE "↷|^Workflow|100%"
Job: test
✓ Run pip install -q -r requirements.txt && pytest -q
3 passed in 0.01s
Job succeeded
Job: deploy
Environment: production
✓ Run echo "Deploying v2.0.0"
Deploying v2.0.0
Job succeeded
Prefer to watch? The full CI/CD with GitHub Actions course is free All lessons in one video with animations, real code and chapters.
Watch free What if the tests fail? We break the discount function, and push the same kind of tag. The test job fails, so the deploy job is skipped, and nothing broken reaches production. And a tag that doesn't start with v, like release one, doesn't trigger the workflow at all.
Terminal Copy commands
sed -i 's#percent / 100#percent / 10#' app.py
run-steps .github/workflows/deploy.yml --tag v2.0.1 | grep -E "^Job|✗|skipped"
Job: test
✗ Run pip install -q -r requirements.txt && pytest -q
Job: deploy
- skipped, because a job it needs failed
run-steps .github/workflows/deploy.yml --tag release-1
Workflow: Deploy on tag (event: push, tag: release-1)
Not triggered: tag release-1 is not in ['v*']
Tag triggered deploys, with tests first, are a simple and reliable release flow. Next, practice with staging and production.
Key takeaways tags: ["v*"] needs: test environment: production