mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-05-19 10:28:48 +02:00
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>
42 lines
1.0 KiB
YAML
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
|