This directory contains GitHub Actions workflows and setup documentation for automating container builds and deployments to Azure.
| Document | Purpose | Start Here? |
|---|---|---|
| QUICKSTART.md | Get up and running in 5 minutes | β YES |
| PREREQUISITES.md | Required tools and installation instructions | If setup script fails |
| workflows/README.md | Detailed workflow configuration and troubleshooting | For advanced setup |
cd /home/wesleyb/git/fluxion/.github
./check-prerequisites.shThis will verify you have:
- β Azure CLI (installed and logged in)
- β GitHub CLI (installed and logged in)
- β jq (JSON processor)
- β Terraform state with ACR deployed
cd workflows
./setup-acr-auth.shThis automated script will:
- Create Azure service principal or federated credentials
- Configure GitHub repository secrets
- Set up all authentication automatically
cd /home/wesleyb/git/fluxion
git add .github/
git commit -m "ci: add GitHub Actions workflows for ACR"
git push origin main# Make a small change
echo "# Test" >> backend/README.md
# Push to trigger workflow
git checkout -b test/build
git add backend/README.md
git commit -m "test: trigger build"
git push origin test/build
# Watch the workflow
gh run watch| Script | Purpose |
|---|---|
check-prerequisites.sh |
Verify all required tools are installed |
workflows/setup-acr-auth.sh |
Automated setup for GitHub Actions + ACR |
| Workflow | Purpose | Trigger |
|---|---|---|
build-push-acr.yml |
Build and push containers to ACR | Push to main/develop |
Before running the setup:
-
Azure CLI - For Azure authentication
# Install: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli az login -
GitHub CLI - For repository configuration
# Install: https://cli.github.com/ gh auth login -
jq - For JSON processing
# Linux: sudo apt-get install jq # macOS: brew install jq
See PREREQUISITES.md for detailed installation instructions.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Developer Workflow β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
git push (main/develop)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GitHub Actions β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Build Backendβ βBuild Frontendβ βSecurity Scan β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
docker push to ACR
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Azure Container Registry (ACR) β
β β’ fluxiondevacr.azurecr.io/fluxion-backend:latest β
β β’ fluxiondevacr.azurecr.io/fluxion-frontend:latest β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Image pull by AKS
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Azure Kubernetes Service β
β (via ArgoCD) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Two authentication methods are supported:
./workflows/setup-acr-auth.sh
# Choose option 1Creates:
- Service principal with AcrPush role
- GitHub secret:
AZURE_CREDENTIALS
./workflows/setup-acr-auth.sh
# Choose option 2Creates:
- App registration with federated identity
- GitHub secrets:
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_SUBSCRIPTION_ID - More secure (no long-lived secrets)
| Event | Branches | Actions |
|---|---|---|
| Push | main |
Build + Push (tag: latest) + Security Scan + Update manifests |
| Push | develop |
Build + Push (tag: dev-latest) + Security Scan + Update manifests |
| Pull Request | main |
Build only (no push) for validation |
Every build creates multiple tags:
| Tag Format | Example | Use Case |
|---|---|---|
latest |
latest |
Production deployments (from main) |
dev-latest |
dev-latest |
Development deployments (from develop) |
{branch}-{sha} |
main-a1b2c3d |
Specific version tracking |
pr-{number} |
pr-42 |
Pull request testing |
# List recent runs
gh run list --workflow=build-push-acr.yml
# Watch current run
gh run watch
# View specific run logs
gh run view {run-id} --logcd /home/wesleyb/git/fluxion/terraform
# List repositories
az acr repository list --name $(terraform output -raw acr_name)
# List tags for backend
az acr repository show-tags \
--name $(terraform output -raw acr_name) \
--repository fluxion-backend \
--orderby time_descGitHub Security tab: https://github.com/wesback/fluxion/security/code-scanning
-
Run prerequisites check:
./check-prerequisites.sh
-
Fix any issues marked with β
-
Re-run setup script
# Verify secrets are set
gh secret list
# Verify ACR permissions
cd terraform
az role assignment list --scope $(terraform output -raw acr_id)# Verify AKS has pull permissions
cd terraform
az role assignment list \
--assignee $(terraform output -raw kubelet_identity_object_id) \
--scope $(terraform output -raw acr_id)See workflows/README.md for detailed troubleshooting.
- Terraform ACR Module: ../terraform/modules/acr/
- ArgoCD Setup: ../deploy/argocd/README.md
- ArgoCD Image Updater: ../deploy/argocd/IMAGE-UPDATER.md
- Helm Charts: ../deploy/helm/fluxion/
When adding new workflows:
- Test locally first (if possible)
- Use descriptive job and step names
- Add comments explaining complex logic
- Update this README with new workflows
- Document any new secrets/variables needed
-
ACR vs GHCR: This setup uses Azure Container Registry (ACR) because your infrastructure is on Azure. See ACR_VS_GHCR.md for comparison.
-
Cost: ACR Standard tier costs ~$20/month. You can switch to Basic ($5/month) if needed.
-
Security: Images are automatically scanned for vulnerabilities using Trivy. Check results in GitHub Security tab.
-
GitOps: Workflows automatically update Helm values files, which ArgoCD then syncs to your cluster.
- Check QUICKSTART.md for common setup steps
- Review PREREQUISITES.md for tool installation
- See workflows/README.md for detailed configuration
- Run
./check-prerequisites.shto diagnose issues - Check GitHub Actions logs:
gh run view --log
- Prerequisites verified (
./check-prerequisites.shpasses) - Setup script completed (
./workflows/setup-acr-auth.sh) - GitHub secrets configured (
gh secret list) - Workflows committed and pushed
- Test build triggered and passed
- Images visible in ACR (
az acr repository list) - Security scans passing
- Helm values updated to reference ACR
- Application deployed in AKS
Once all items are checked, your CI/CD pipeline is fully operational! π