All checks were successful
Deploy Backend (Manual Build) / deploy (push) Successful in 12s
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
name: Deploy Backend (Manual Build)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Restore kubeconfig
|
|
run: |
|
|
mkdir -p ~/.kube
|
|
echo "$KUBECONFIG_DATA" | base64 -d > ~/.kube/config
|
|
chmod 600 ~/.kube/config
|
|
env:
|
|
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG }}
|
|
|
|
- name: Install kubectl
|
|
run: |
|
|
curl -LO "https://dl.k8s.io/release/v1.28.0/bin/linux/amd64/kubectl"
|
|
chmod +x kubectl
|
|
sudo mv kubectl /usr/local/bin/kubectl
|
|
|
|
- name: 🚀 Trigger Deployment Restart
|
|
run: |
|
|
echo "Restarting deployment to pull latest image..."
|
|
/usr/local/bin/kubectl rollout restart deployment/dashboard-backend -n cloudforge || {
|
|
echo "Deployment not found, skipping restart"
|
|
}
|
|
|
|
- name: ✅ Verify Status
|
|
run: |
|
|
/usr/local/bin/kubectl rollout status deployment/dashboard-backend -n cloudforge --timeout=300s 2>/dev/null || {
|
|
echo "No existing deployment, you need to deploy manually first"
|
|
echo ""
|
|
echo "Manual deployment steps:"
|
|
echo "1. cd dashboard-backend"
|
|
echo "2. Build: podman build -t cloudforge-dashboard-backend:latest ."
|
|
echo "3. Push to registry or save as tar"
|
|
echo "4. Then run Gitea push to trigger this workflow"
|
|
}
|