CI/CD - Continuous Integration & Deployment
Status: Active
Last Updated: 2026-08-26
Category: CI/CD & GitOps
Prerequisites: kb/basics/git-fundamentals, kb/containers/docker-basics
Tags: ci-cd, forgejo, woodpecker-ci, gitops, automation, pipelines, self-hosted
Summary
Complete learning path for Continuous Integration and Continuous Deployment using self-hosted, open-source tools. Focus on Forgejo (Git hosting) + Woodpecker CI (pipelines) as the GitLab/GitHub Actions alternative for homelabs and small-medium teams.
๐ฏ Learning Philosophy
Git โ CI โ CD โ GitOps:
Git Basics โ Forgejo Setup โ Woodpecker CI โ Auto Deploy โ GitOps
(Version) (Self-Host) (Pipelines) (Delivery) (Production)
This directory teaches CI/CD assuming basic Git knowledge but no prior CI/CD experience. Progression from manual builds through fully automated GitOps deployments.
๐ Learning Path
Prerequisites: Git fundamentals, Docker basics
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 1: CI/CD Concepts โ
โ โโ What is CI/CD? โ
โ โโ Build โ Test โ Deploy โ
โ โโ Why automation matters โ
โ โโ Manual vs automated workflows โ
โ โโ Self-hosted vs cloud services โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 2: Forgejo (Git Hosting) โ
โ โโ Self-hosted Git (GitHub alt) โ
โ โโ Forgejo installation โ
โ โโ User/organization management โ
โ โโ Repository setup โ
โ โโ Access control & SSH keys โ
โ โโ Webhooks integration โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 3: Woodpecker CI โ
โ โโ Container-native CI/CD โ
โ โโ Woodpecker installation โ
โ โโ First pipeline (.woodpecker.yml) โ
โ โโ Build steps & Docker images โ
โ โโ Testing automation โ
โ โโ Secrets management โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 4: Advanced Pipelines โ
โ โโ Multi-stage builds โ
โ โโ Matrix builds (multi-platform) โ
โ โโ Caching strategies โ
โ โโ Building Docker images โ
โ โโ Publishing to Harbor registry โ
โ โโ Deployment automation โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHASE 5: GitOps & Production โ
โ โโ GitOps principles โ
โ โโ Infrastructure as Code integration โ
โ โโ Kubernetes/k0s deployments โ
โ โโ Rollback strategies โ
โ โโ Monitoring & alerting โ
โ โโ Production best practices โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Articles in This Directory
โ Recently Created (2026-08-26 headless-browser research session)
- woodpecker-installation โ Server+agent Docker Compose install wired to Forgejo (OAuth, shared secret, Traefik labels). โ CREATED 2026-08-26
- woodpecker-first-pipeline โ .woodpecker.yml anatomy, filters, secrets, image publishing via buildx, matrix builds. โ CREATED 2026-08-26
- rollback-procedures โ Docker Compose / k3s rollout undo / GitOps git-revert rollback playbooks; DB-migration compatibility caveats. โ CREATED 2026-08-26
๐ข Phase 1: CI/CD Fundamentals (Start Here)
Understanding the Basics:
cicd-concepts - What is CI/CD and why it matters
- Continuous Integration explained
- Continuous Deployment vs Delivery
- Traditional vs modern workflows
- Benefits and tradeoffs
- Prerequisites: None
- Time: 1 hour
- Resources:
[โโโโโโโโโโ]20% - Conceptual
manual-vs-automated - Why automate your workflow
- Manual deployment pain points
- Automation benefits
- When to automate
- Cost-benefit analysis
- Prerequisites: Development experience
- Time: 1 hour
- Resources:
[โโโโโโโโโโ]20%
self-hosted-vs-cloud - Self-hosted CI/CD advantages
- GitHub Actions vs Woodpecker
- GitLab CI/CD vs self-hosted
- Privacy and control
- Cost comparison
- Prerequisites: CI/CD concepts
- Time: 1 hour
- Resources:
[โโโโโโโโโโ]20%
๐ก Phase 2: Forgejo (Self-Hosted Git)
forgejo-introduction - Forgejo as GitHub alternative
- What is Forgejo (Gitea fork)
- Why Forgejo over Gitea/GitLab
- Feature comparison
- Use cases
- Prerequisites: Git basics
- Time: 1 hour
- Resources:
[โโโโโโโโโโ]20%
forgejo-installation - Installing Forgejo
- Docker compose setup
- Reverse proxy (Traefik/Caddy)
- Database configuration
- Initial admin setup
- SSL/TLS configuration
- Prerequisites: Docker basics
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]50% - 2GB RAM
forgejo-organization - Organizing repositories
- Creating organizations
- Team management
- Repository permissions
- SSH key management
- Webhook configuration
- Prerequisites: Forgejo installed
- Time: 2 hours
- Resources:
[โโโโโโโโโโ]30%
migrating-to-forgejo - Migrate from GitHub/GitLab
- Repository migration tools
- Preserving history
- Updating CI/CD configs
- Team transition
- Prerequisites: Existing Git repos
- Time: 2-4 hours
- Resources:
[โโโโโโโโโโ]40%
๐ Phase 3: Woodpecker CI (Pipeline Automation)
woodpecker-introduction - Container-native CI/CD
- What is Woodpecker CI
- Drone CI fork benefits
- Architecture overview
- Forgejo integration
- Prerequisites: CI/CD concepts
- Time: 1 hour
- Resources:
[โโโโโโโโโโ]20%
woodpecker-installation - Installing Woodpecker
- Docker compose deployment
- Forgejo OAuth setup
- Agent configuration
- First repository activation
- Prerequisites: Forgejo running
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]50% - 2GB RAM
first-pipeline - Your first .woodpecker.yml
- Pipeline syntax basics
- Build steps
- Docker image selection
- Testing commands
- Pipeline execution
- Prerequisites: Woodpecker installed
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]40%
pipeline-syntax - Woodpecker YAML deep dive
- Pipeline structure
- Step configuration
- Environment variables
- Conditional execution
- Services (databases, Redis)
- Prerequisites: First pipeline
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]50%
secrets-management - Secure secrets in pipelines
- Adding secrets to Woodpecker
- Environment-specific secrets
- Using secrets in steps
- Security best practices
- Cross-reference: kb/security/vault-basics
- Prerequisites: Pipeline basics
- Time: 2 hours
- Resources:
[โโโโโโโโโโ]40%
๐ด Phase 4: Advanced Pipelines (Power User)
matrix-builds - Multi-platform testing
- Matrix strategy explained
- Testing multiple versions
- Cross-platform builds
- Parallel execution
- Prerequisites: Pipeline syntax
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]60%
caching-strategies - Speed up pipelines
- Volume caching
- Dependency caching
- Docker layer caching
- Cache invalidation
- Prerequisites: Advanced pipelines
- Time: 2 hours
- Resources:
[โโโโโโโโโโ]50%
building-docker-images - Build containers in CI
- Docker-in-Docker
- BuildKit usage
- Multi-stage builds
- Image tagging strategies
- Pushing to Harbor registry
- Prerequisites: Docker fundamentals
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]70%
testing-automation - Automated test suites
- Unit tests in pipeline
- Integration tests
- Linting and formatting
- Code coverage
- Test reports
- Prerequisites: Testing knowledge
- Time: 4-5 hours
- Resources:
[โโโโโโโโโโ]60%
deployment-patterns - Deploy from CI
- SSH deployments
- Docker compose deployments
- Kubernetes/k0s deployments
- Blue-green deployments
- Canary releases
- Prerequisites: Infrastructure knowledge
- Time: 4-6 hours
- Resources:
[โโโโโโโโโโ]80%
โซ Phase 5: GitOps & Production (Enterprise-Ready)
gitops-principles - Git as source of truth
- What is GitOps
- Git-centric workflow
- Declarative configuration
- Reconciliation loops
- Prerequisites: K8s or infrastructure basics
- Time: 2-3 hours
- Resources:
[โโโโโโโโโโ]40%
gitops-with-argocd - ArgoCD for k0s
- ArgoCD installation on k0s
- Application definitions
- Sync strategies
- Self-healing apps
- Prerequisites: k0s cluster
- Time: 4-5 hours
- Resources:
[โโโโโโโโโโ]80%
monitoring-pipelines - CI/CD observability
- Pipeline metrics
- Failed build alerts
- Slack/Discord notifications
- Prometheus metrics
- Grafana dashboards
- Cross-reference: kb/observability/
- Prerequisites: CI/CD running
- Time: 3-4 hours
- Resources:
[โโโโโโโโโโ]60%
production-best-practices - Production CI/CD
- Environment promotion
- Approval workflows
- Rollback strategies
- Security scanning
- Compliance auditing
- Prerequisites: Production experience
- Time: 4-6 hours
- Resources:
[โโโโโโโโโโ]90%
๐ What Comes Next?
After mastering CI/CD:
For Infrastructure Automation:
- kb/infrastructure/ansible-basics - Deploy with Ansible
- kb/infrastructure/terraform-basics - Provision with Terraform
- kb/infrastructure/gitops-infrastructure - GitOps for infra
For Container Orchestration:
- kb/containers/k0s-installation - Deploy to k0s
- kb/containers/k0s-deployments - k8s deployments
For Security:
- kb/security/vault-basics - Vault for secrets
- kb/security/container-scanning - Image security
For Monitoring:
- kb/observability/prometheus-grafana - Monitor pipelines
๐ Resource Requirements
Forgejo:
- Minimal: 512MB RAM, 1 CPU, 5GB disk
[โโโโโโโโโโ]30% - Comfortable: 1GB RAM, 2 CPU, 20GB disk
[โโโโโโโโโโ]40% - Production: 2GB RAM, 2 CPU, 50GB disk
[โโโโโโโโโโ]60%
Woodpecker CI Server:
- Minimal: 512MB RAM, 1 CPU
[โโโโโโโโโโ]30% - Comfortable: 1GB RAM, 2 CPU
[โโโโโโโโโโ]40%
Woodpecker CI Agent (per agent):
- Minimal: 1GB RAM, 1 CPU
[โโโโโโโโโโ]40% - Comfortable: 2GB RAM, 2 CPU
[โโโโโโโโโโ]50% - Heavy builds: 4GB RAM, 4 CPU
[โโโโโโโโโโ]70%
Complete Stack (Forgejo + Woodpecker + Agent):
- Minimal: 3GB RAM, 3 CPU
[โโโโโโโโโโ]50% - Comfortable: 6GB RAM, 4 CPU
[โโโโโโโโโโ]70% - Production: 8GB+ RAM, 6+ CPU
[โโโโโโโโโโ]80%
Learning Time Investment:
- CI/CD Concepts: 1 week
[โโโโโโโโโโ]30% - Forgejo Setup: 1 week
[โโโโโโโโโโ]40% - Woodpecker Basics: 2 weeks
[โโโโโโโโโโ]50% - Advanced Pipelines: 3-4 weeks
[โโโโโโโโโโ]70% - GitOps Production: 2-3 months
[โโโโโโโโโโ]90% - CI/CD Mastery: 6-12 months
[โโโโโโโโโโ]100%
๐ ๏ธ Recommended Tool Stack
Core Stack (Required):
- Forgejo
[โโโโโโโโโโ]Required - Git hosting - Woodpecker CI
[โโโโโโโโโโ]Required - Pipeline runner - Docker
[โโโโโโโโโโ]Required - Container runtime
Supporting Tools:
- Harbor
[โโโโโโโโโโ]80% - Container registry - Traefik/Caddy
[โโโโโโโโโโ]80% - Reverse proxy - PostgreSQL
[โโโโโโโโโโ]70% - Database (vs SQLite) - Redis
[โโโโโโโโโโ]50% - Caching (optional)
GitOps Tools:
- ArgoCD
[โโโโโโโโโโ]80% - k8s GitOps - Flux
[โโโโโโโโโโ]70% - Alternative to ArgoCD - Ansible
[โโโโโโโโโโ]80% - VM deployments
Alternatives to Consider:
- Gitea
[โโโโโโโโโโ]70% - If Forgejo too new - Drone CI
[โโโโโโโโโโ]60% - Woodpecker upstream - Jenkins
[โโโโโโโโโโ]40% - Classic but heavy - Concourse CI
[โโโโโโโโโโ]50% - Complex but powerful
๐ก Pro Tips for CI/CD
- Start Simple: One repo, one pipeline, manual deploy first
- Version Pipelines: Pipeline configs in Git, versioned with code
- Fail Fast: Quick feedback loops, fail early in pipeline
- Idempotent Builds: Same input โ same output, always
- Secrets Never in Git: Use secret management, never commit
- Monitor Everything: Pipeline metrics, build times, failure rates
- Cache Aggressively: Dependencies, build artifacts, Docker layers
- Test Locally: Run pipelines locally before pushing
- Document Processes: README with build/deploy instructions
- Automate Incrementally: Build โ Test โ Deploy, step by step
๐ Common Learning Pitfalls
Pitfall 1: Over-Automating Too Soon
- Automating before understanding process
- Fix: Manual first, document, then automate
Pitfall 2: No Testing in Pipeline
- Deploying without tests
- Fix: Add tests before auto-deploy
Pitfall 3: Secrets in Git
- Committing API keys, passwords
- Fix: Use Woodpecker secrets, Vault
Pitfall 4: No Rollback Plan
- Breaking production with no undo
- Fix: Blue-green deployments, versioned releases
Pitfall 5: Ignoring Pipeline Failures
- Broken main branch, ignoring red builds
- Fix: Fix immediately, never merge broken code
Pitfall 6: Complex Pipelines
- Overly complicated YAML, hard to debug
- Fix: Keep simple, modular, readable
Pitfall 7: No Local Testing
- Only testing in CI, slow feedback
- Fix: Docker compose local env
Pitfall 8: Single Agent Bottleneck
- One agent, long queues
- Fix: Multiple agents for parallel builds
๐ Related KB Sections
- kb/basics/git-fundamentals - Git prerequisite
- kb/containers/ - Docker/k0s for deployments
- kb/infrastructure/ - IaC integration
- kb/security/ - Secrets, scanning
- kb/observability/ - Pipeline monitoring
- kb/gitops/ - GitOps workflows
๐ Change Log
2026-01-30
- Created CI/CD directory structure
- Defined complete learning path from concepts to GitOps
- Established Forgejo + Woodpecker as core stack
- Listed all planned articles with time estimates
- Added resource requirements for each component
- Emphasized self-hosted, open-source tools
- Organized by learning phases (1-5)
- Added tool alternatives and comparisons
- Cross-referenced related KB sections
- Included production best practices path
๐ Remember: CI/CD transforms development workflow. Automating builds, tests, and deployments saves hours daily, catches bugs early, and enables rapid iteration. Start with Forgejo + Woodpecker for privacy, control, and cost-effectiveness!
Change Log
- 2026-08-26: Added 2 new articles created via headless-browser web research session; marked planned items as created.
- 2026-08-26: Added rollback-procedures โ completes all planned Phase articles for this section (plan's
nftables-advanced/prometheus-installationnaming reconciled to existing files in other sections).