added full cli package and CI execution
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
name: Hourly Energy Data Sync
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Run every hour at minute 5 (to avoid peak times)
|
||||
- cron: "5 * * * *"
|
||||
workflow_dispatch: # Allow manual triggering
|
||||
|
||||
jobs:
|
||||
sync-energy-data:
|
||||
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 incremental sync
|
||||
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 sync-incremental --verbose
|
||||
|
||||
- name: Notify on failure
|
||||
if: failure()
|
||||
run: |
|
||||
echo "Energy data sync failed! Check logs and database connectivity."
|
||||
# Add notification logic here (email, Slack, etc.)
|
||||
exit 1
|
||||
Reference in New Issue
Block a user