|
| 1 | +# GitHub Actions Workflows |
| 2 | + |
| 3 | +This directory contains GitHub Actions workflows for the DevOps The Hard Way - Azure tutorial. |
| 4 | + |
| 5 | +## 📋 Workflow Files |
| 6 | + |
| 7 | +### 🔧 `main.yml` - Tutorial Example Workflow |
| 8 | +**Purpose**: Educational content demonstrating CI/CD pipeline setup |
| 9 | +**Status**: ⚠️ **DISABLED** - Tutorial content only |
| 10 | + |
| 11 | +This workflow is provided as an example for learning purposes and is **not intended to run** in this tutorial repository. |
| 12 | + |
| 13 | +**Features:** |
| 14 | +- Terraform deployment automation |
| 15 | +- Azure OIDC authentication |
| 16 | +- Static code analysis hooks (commented) |
| 17 | +- Terraform documentation generation hooks (commented) |
| 18 | + |
| 19 | +**To Use This Workflow:** |
| 20 | +1. Fork or copy this repository to your own GitHub account |
| 21 | +2. Set up Azure OIDC authentication (see tutorial) |
| 22 | +3. Enable the workflow by modifying the `on:` triggers |
| 23 | +4. Customize the configuration for your environment |
| 24 | + |
| 25 | +### 🚀 `deploy-full.yml` - Complete Deployment Pipeline |
| 26 | +**Purpose**: Full infrastructure and application deployment |
| 27 | +**Status**: ✅ **ACTIVE** - Manual trigger only |
| 28 | + |
| 29 | +This workflow provides complete deployment automation including: |
| 30 | +- Infrastructure provisioning (ACR, VNET, Log Analytics, AKS) |
| 31 | +- Docker image building and pushing |
| 32 | +- Kubernetes application deployment |
| 33 | +- ALB Controller and Gateway setup |
| 34 | +- Optional resource cleanup |
| 35 | + |
| 36 | +**Triggers:** |
| 37 | +- Manual execution only (`workflow_dispatch`) |
| 38 | +- Environment selection (dev/staging/prod) |
| 39 | +- Optional cleanup after deployment |
| 40 | + |
| 41 | +## 🎓 Educational Notes |
| 42 | + |
| 43 | +### Why Two Workflows? |
| 44 | + |
| 45 | +1. **`main.yml`**: Demonstrates traditional CI/CD patterns |
| 46 | + - Shows basic Terraform automation |
| 47 | + - Includes hooks for advanced features |
| 48 | + - Focuses on single component (AKS) |
| 49 | + - Educational and reference material |
| 50 | + |
| 51 | +2. **`deploy-full.yml`**: Complete solution approach |
| 52 | + - Deploys entire infrastructure stack |
| 53 | + - Production-ready patterns |
| 54 | + - Multi-environment support |
| 55 | + - Practical automation tool |
| 56 | + |
| 57 | +### Security Considerations |
| 58 | + |
| 59 | +Both workflows use: |
| 60 | +- ✅ Azure OIDC authentication (no stored secrets) |
| 61 | +- ✅ Least privilege access patterns |
| 62 | +- ✅ Environment-specific configurations |
| 63 | +- ✅ Manual approval workflows for production |
| 64 | + |
| 65 | +### Best Practices Demonstrated |
| 66 | + |
| 67 | +- **Infrastructure as Code**: All resources defined in Terraform |
| 68 | +- **GitOps**: Infrastructure changes through Git workflows |
| 69 | +- **Immutable Infrastructure**: Complete rebuilds vs. updates |
| 70 | +- **Environment Isolation**: Separate state files and configurations |
| 71 | +- **Automated Testing**: Built-in validation and testing steps |
| 72 | + |
| 73 | +## 🔧 Setup Instructions |
| 74 | + |
| 75 | +### For Tutorial Learning: |
| 76 | +1. Study the workflow files as examples |
| 77 | +2. Understand the patterns and practices |
| 78 | +3. Follow the tutorial documentation |
| 79 | + |
| 80 | +### For Practical Use: |
| 81 | +1. Copy/fork this repository |
| 82 | +2. Set up Azure service principal or OIDC |
| 83 | +3. Configure GitHub secrets |
| 84 | +4. Customize for your environment |
| 85 | +5. Enable and run workflows |
| 86 | + |
| 87 | +## 📚 Related Documentation |
| 88 | + |
| 89 | +- [CI/CD Tutorial](../2-Terraform-AZURE-Services-Creation/5-Run-CICD-For-AKS-Cluster.md) |
| 90 | +- [Deployment Scripts](../scripts/README.md) |
| 91 | +- [Azure OIDC Setup](../2-Terraform-AZURE-Services-Creation/scripts/5-create-github-oidc.sh) |
| 92 | + |
| 93 | +## 🤝 Contributing |
| 94 | + |
| 95 | +These workflows are part of the tutorial content. If you find improvements or issues: |
| 96 | +- Open an issue for discussion |
| 97 | +- Submit a pull request with improvements |
| 98 | +- Update related documentation |
0 commit comments