2.1 KiB
2.1 KiB
🚀 Auto-Deployment Status
Current Setup
GitHub Actions Workflow (.github/workflows/ci-cd.yml)
Triggers on: Push to main OR production branches
What happens on main branch:
- ✅ Runs tests
- ✅ Runs linting
- ✅ Builds Docker image
- ✅ Pushes image to registry
- ❌ Does NOT deploy to server
What happens on production branch:
- ✅ Runs tests
- ✅ Runs linting
- ✅ Builds Docker image
- ✅ Pushes image to registry
- ✅ Deploys to server automatically
Key Line in Workflow
# Line 159 in .github/workflows/ci-cd.yml
if: github.event_name == 'push' && github.ref == 'refs/heads/production'
This means deployment only happens on production branch.
Answer: Can you merge to main and auto-deploy?
❌ NO - Merging to main will:
- Build and test everything
- Create Docker image
- But NOT deploy to your server
✅ YES - Merging to production will:
- Build and test everything
- Create Docker image
- AND deploy to your server automatically
Options
Option 1: Use Production Branch (Current Setup)
# Merge dev → main (tests/build only)
git checkout main
git merge dev
git push origin main
# Then merge main → production (auto-deploys)
git checkout production
git merge main
git push origin production # ← This triggers deployment
Option 2: Enable Auto-Deploy on Main
If you want main to auto-deploy, I can update the workflow to deploy on main as well.
Option 3: Manual Deployment
After merging to main, manually run:
./scripts/gitea-deploy.sh
# or
./scripts/auto-deploy.sh
Recommendation
Keep current setup (deploy only on production):
- ✅ Safer:
mainis for testing builds - ✅
productionis explicitly for deployments - ✅ Can test on
mainwithout deploying - ✅ Clear separation of concerns
Workflow:
- Merge
dev→main(validates build works) - Test the built image if needed
- Merge
main→production(auto-deploys)
Current Status: Auto-deployment is configured, but only for production branch.