name: Deploy to Production on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy to Production Server uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.PROD_HOST }} username: ${{ secrets.PROD_USER }} key: ${{ secrets.PROD_SSH_KEY }} script: | set -euo pipefail cd ~/apps/personal-portfolio echo "Pulling latest changes..." git fetch origin main git reset --hard origin/main echo "Activating virtual environment..." source .venv/bin/activate echo "Installing dependencies..." pip install -r requirements.txt --quiet echo "Running dbt models..." cd dbt && dbt run --profiles-dir . && cd .. echo "Restarting application..." docker compose down docker compose up -d echo "Waiting for health check..." sleep 10 curl -f http://localhost:8050/health || exit 1 echo "Production deployment complete!"