Files
WealthySmart/.github/workflows/deploy.yml
Carlos Escalante 8d76059ae8
All checks were successful
Deploy to VPS / deploy (push) Successful in 34s
Add budget module and push notifications for transactions
Budget: recurring items CRUD, yearly/monthly projections with no-double-count
logic, and full UI (overview, monthly detail, recurring items manager).

Push notifications: Web Push via VAPID keys, triggered on transaction creation
from n8n. Includes service worker handlers, frontend subscription flow, and
a test button on the Dashboard (temporary).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 22:28:14 -06:00

51 lines
1.5 KiB
YAML

name: Deploy to VPS
on:
push:
branches: [main]
jobs:
deploy:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Write .env.prod
run: |
cat > .env.prod <<'ENVEOF'
POSTGRES_USER=${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB=${{ secrets.POSTGRES_DB }}
SECRET_KEY=${{ secrets.SECRET_KEY }}
ADMIN_USERNAME=${{ secrets.ADMIN_USERNAME }}
ADMIN_PASSWORD=${{ secrets.ADMIN_PASSWORD }}
LETSENCRYPT_EMAIL=${{ secrets.LETSENCRYPT_EMAIL }}
VAPID_PRIVATE_KEY=${{ secrets.VAPID_PRIVATE_KEY }}
VAPID_PUBLIC_KEY=${{ secrets.VAPID_PUBLIC_KEY }}
ENVEOF
sed -i 's/^[[:space:]]*//' .env.prod
- name: Build and deploy
run: |
docker compose -f docker-compose.prod.yml --env-file .env.prod build
docker compose -f docker-compose.prod.yml --env-file .env.prod up -d --remove-orphans
- name: Wait for health
run: |
echo "Waiting for backend..."
for i in $(seq 1 30); do
if docker inspect wealthysmart-backend-prod --format '{{.State.Health.Status}}' 2>/dev/null | grep -q healthy; then
echo "Backend is healthy"
break
fi
sleep 2
done
- name: Prune old images
run: docker image prune -f
- name: Cleanup
if: always()
run: rm -f .env.prod