Files
WealthySmart/.github/workflows/deploy.yml
Carlos Escalante 750d54faa7 Add landing page, Docker setup, and CI/CD pipeline
React + Vite + TypeScript + Tailwind frontend with landing page,
Docker Compose for dev and prod (nginx-proxy integration),
and Gitea Actions workflow for automated deployment.

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

42 lines
1.0 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'
LETSENCRYPT_EMAIL=${{ secrets.LETSENCRYPT_EMAIL }}
ENVEOF
- 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 frontend..."
for i in $(seq 1 30); do
if docker inspect wealthysmart-frontend-prod --format '{{.State.Health.Status}}' 2>/dev/null | grep -q healthy; then
echo "Frontend 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