fix: merge monitoring deploy into single job
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 51s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 51s
Monitoring was in a separate blocked job. Now everything runs in one SSH session so Prometheus + Grafana always deploy with the app. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -66,6 +66,10 @@ jobs:
|
|||||||
echo "=== Deploy summary ==="
|
echo "=== Deploy summary ==="
|
||||||
docker compose ps
|
docker compose ps
|
||||||
echo "Health: $(curl -sf http://localhost:8001/health 2>/dev/null || echo 'FAILED')"
|
echo "Health: $(curl -sf http://localhost:8001/health 2>/dev/null || echo 'FAILED')"
|
||||||
|
|
||||||
|
echo "=== Starting monitoring ==="
|
||||||
|
docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d prometheus grafana node-exporter cadvisor || true
|
||||||
|
docker compose -f docker-compose.yml -f docker-compose.monitoring.yml ps || true
|
||||||
ENDSSH
|
ENDSSH
|
||||||
|
|
||||||
- name: Wait for frontend
|
- name: Wait for frontend
|
||||||
@@ -86,24 +90,3 @@ jobs:
|
|||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
if: always()
|
if: always()
|
||||||
run: ssh root@192.168.1.151 "docker image prune -f" || true
|
run: ssh root@192.168.1.151 "docker image prune -f" || true
|
||||||
|
|
||||||
deploy-monitoring:
|
|
||||||
name: Deploy Monitoring
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: deploy
|
|
||||||
steps:
|
|
||||||
- name: Setup SSH
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
|
||||||
chmod 600 ~/.ssh/id_rsa
|
|
||||||
ssh-keyscan -H 192.168.1.151 >> ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
- name: Start monitoring
|
|
||||||
run: |
|
|
||||||
ssh root@192.168.1.151 << 'ENDSSH'
|
|
||||||
cd /opt/wordly
|
|
||||||
docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d prometheus grafana node-exporter cadvisor
|
|
||||||
docker compose -f docker-compose.yml -f docker-compose.monitoring.yml ps
|
|
||||||
ENDSSH
|
|
||||||
continue-on-error: true
|
|
||||||
|
|||||||
Reference in New Issue
Block a user