name: Deploy to VPS on: push: branches: [main] workflow_dispatch: jobs: deploy: runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 - name: Build and start containers run: docker compose up -d --build --remove-orphans env: RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} RESEND_FROM: ${{ secrets.RESEND_FROM }} - name: Prune dangling images run: docker image prune -f - name: Health check run: | for i in $(seq 1 30); do if curl -fsS http://localhost:4073 > /dev/null; then echo "App is up" exit 0 fi sleep 2 done echo "App did not become healthy" >&2 exit 1