name: Daily Health Check on: schedule: # Run daily at 6:00 AM UTC - cron: "0 6 * * *" workflow_dispatch: # Allow manual triggering jobs: health-check: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.12" - name: Install uv run: | curl -LsSf https://astral.sh/uv/install.sh | sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Install dependencies run: | uv sync - name: Run health check env: ELOVERBLIK_API_TOKEN: ${{ secrets.ELOVERBLIK_API_TOKEN }} DB_HOST: ${{ secrets.DB_HOST }} DB_NAME: ${{ secrets.DB_NAME }} DB_USER: ${{ secrets.DB_USER }} DB_PASSWORD: ${{ secrets.DB_PASSWORD }} DB_PORT: ${{ secrets.DB_PORT }} run: | uv run energy-ingester health-check --verbose - name: Report status run: | echo "Health check completed successfully!" - name: Notify on failure if: failure() run: | echo "Health check failed! System may be down." # Add notification logic here (email, Slack, etc.) exit 1