GitHub Actions Setup Guide
GitHub Actions Setup Guide
Section titled “GitHub Actions Setup Guide”This guide will help you configure GitHub Actions for automatic deployment to Oracle Cloud.
Required GitHub Secrets
Section titled “Required GitHub Secrets”Go to your repository Settings → Secrets and variables → Actions and add:
🔑 SSH Configuration
Section titled “🔑 SSH Configuration”ORACLE_SSH_KEY
# Copy your private SSH key contentcat ~/.ssh/oracle_key_correct
Paste the entire private key (including -----BEGIN...
and -----END...
lines)
ORACLE_HOST
79.72.87.238
How It Works
Section titled “How It Works”🔄 Automatic Deployment
Section titled “🔄 Automatic Deployment”- Trigger: When you push changes to
zitadel/
folder onmain
branch - Process:
- 🔍 Detects configuration changes
- 💾 Creates automatic backup
- 🚀 Deploys new configuration
- 🏥 Runs health checks
- 🆘 Auto-rollback if deployment fails
🔒 Security Features
Section titled “🔒 Security Features”- Trivy security scanning on every push
- Secrets are never logged
- SSH keys are temporarily created and destroyed
- Automatic vulnerability detection
💾 Backup Strategy
Section titled “💾 Backup Strategy”- Automatic backup before every deployment
- Database dump included
- Keeps last 5 backups
- One-click rollback capability
Testing the Setup
Section titled “Testing the Setup”1. Manual Trigger
Section titled “1. Manual Trigger”Go to Actions → Deploy Zitadel to Oracle Cloud → Run workflow
2. Test with Small Change
Section titled “2. Test with Small Change”Edit zitadel/README.md
and push to main branch:
echo "Test deployment at $(date)" >> zitadel/README.mdgit add zitadel/README.mdgit commit -m "Test GitOps deployment"git push
3. Monitor Deployment
Section titled “3. Monitor Deployment”- Watch the Actions tab for real-time progress
- Check logs for detailed deployment steps
- Verify health at https://auth.wenzelarifiandi.com
Troubleshooting
Section titled “Troubleshooting”❌ SSH Connection Failed
Section titled “❌ SSH Connection Failed”- Verify
ORACLE_SSH_KEY
contains the complete private key - Ensure
ORACLE_HOST
IP is correct - Check Oracle Cloud security rules allow SSH from GitHub Actions IPs
❌ Health Check Failed
Section titled “❌ Health Check Failed”- Check Zitadel logs:
docker-compose logs zitadel
- Verify all services are running:
docker-compose ps
- Manual rollback: Use latest backup in
/home/ubuntu/zitadel-backups/
❌ Permission Denied
Section titled “❌ Permission Denied”- Ensure SSH key has correct permissions on Oracle Cloud
- Verify Ubuntu user can access Docker commands
Advanced Features
Section titled “Advanced Features”🔄 Zero-Downtime Deployments
Section titled “🔄 Zero-Downtime Deployments”- Services are updated with
docker-compose up -d
- Health checks ensure service availability
- Automatic rollback prevents extended downtime
📊 Monitoring Integration
Section titled “📊 Monitoring Integration”Ready for integration with:
- Grafana Cloud (free tier)
- Uptime Robot (free monitoring)
- GitHub Security alerts
🌍 Multi-Environment Support
Section titled “🌍 Multi-Environment Support”Extend for staging/production environments:
- Add environment-specific secrets
- Create separate workflows
- Use environment protection rules
Next Steps
Section titled “Next Steps”- ✅ Add the required secrets
- ✅ Test with a small change
- ✅ Set up monitoring (optional)
- ✅ Add team notifications (optional)
Your Zitadel deployment is now fully automated! 🎉