GitHub Actions CI/CD Pipeline for Django API

Day 11 - "git push" and your tests run, your linter checks, and your app deploys. No clicking. No SSH. Just a YAML file and GitHub does the rest. 🚀TechFromZero Series - GitHubActionsFromZero This isn't a Hello World. It's a real CI/CD pipeline for a real Django API: 📐 git push → GitHub Actions → flake8 lint → pytest (3 Python versions) → deploy to Render 🔗 The full code (with step-by-step commits you can follow): https://lnkd.in/dEwEy9jn 🧱 What I built (step by step): 1️⃣ Project scaffold — Django JSON API with health check, headlines, and search endpoints 2️⃣ First workflow — on:push trigger, ubuntu-latest runner, checkout + setup-python 3️⃣ pytest test suite — 17 unit tests with mock data (no real API calls in CI) 4️⃣ CI test stage — pytest with coverage reporting, fail the build on any error 5️⃣ flake8 linting — catch style issues and bugs before tests even run 6️⃣ Matrix testing — test across Python 3.10, 3.11, 3.12 in parallel 7️⃣ Dependency caching — pip cache with hashFiles(), cut install from 30s to 5s 8️⃣ PR checks — block merging until CI passes (branch protection rules) 9️⃣ Deploy workflow — separate workflow, curl to Render deploy hook, main only 🔟 Secrets + environments — GitHub Secrets for credentials, environment protection rules 1️⃣1️⃣ CI badge + full README — status badge, architecture diagram, setup guide 💡 Every YAML file has detailed comments explaining WHY, not just what. Written for any beginner who wants to learn GitHub Actions by reading real workflows — with full clarity on each step. 👉 If you're a beginner learning CI/CD, clone it and read the commits one by one. Each commit = one concept. Each file = one lesson. Built from scratch, so nothing is hidden. 🔥 This is Day 11 of a 50-day series. A new technology every day. Follow along! 🌐 See all days: https://lnkd.in/dhDN6Z3F #TechFromZero #Day11 #GitHubActions #CICD #Django #Python #Pytest #DevOps #Automation #LearnByDoing #OpenSource #BeginnerGuide #100DaysOfCode #CodingFromScratch

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories