ci: add prod and dev deployment workflows
Some checks failed
Deploy Development / deploy (push) Successful in 55s
Build Test / build-frontend (push) Failing after 2s
Build Test / lint-backend (push) Failing after 1s

This commit is contained in:
Lars Stommer 2026-03-17 12:53:32 +01:00
parent 5091dfd1ce
commit b409a22322
3 changed files with 42 additions and 38 deletions

View File

@ -0,0 +1,21 @@
name: Deploy Development
on:
push:
branches: [develop]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Development
run: |
set -e
echo "=== Deploying to DEVELOPMENT ==="
cd /home/lars/docker/bodytrack-dev
git pull origin develop
docker compose build --no-cache
docker compose up -d
sleep 5
curl -sf http://localhost:8099/api/auth/status && echo "? DEV API healthy"
echo "=== DEV Deploy complete ==="

View File

@ -0,0 +1,21 @@
name: Deploy Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Production
run: |
set -e
echo "=== Deploying to PRODUCTION ==="
cd /home/lars/docker/bodytrack
git pull origin main
docker compose build --no-cache
docker compose up -d
sleep 5
curl -sf http://localhost:8002/api/auth/status && echo "? API healthy"
echo "=== PROD Deploy complete ==="

View File

@ -1,38 +0,0 @@
name: Deploy to Raspberry Pi
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
set -e
cd /home/lars/docker/mitai
echo "=== Pulling latest code ==="
git pull origin main
echo "=== Rebuilding containers ==="
docker compose build --no-cache
echo "=== Restarting ==="
docker compose up -d
echo "=== Health check ==="
sleep 5
docker ps | grep jinkendo
curl -sf http://localhost:8002/api/auth/status | python3 -c "import sys,json; d=json.load(sys.stdin); print('✓ API healthy')" || echo "⚠ API check failed"
echo "=== Deploy complete ==="