Daily Portfolio Analytics #182
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Daily Portfolio Analytics | |
| on: | |
| schedule: | |
| - cron: '0 21 * * 1-5' # 21h00, du lundi au vendredi | |
| workflow_dispatch: | |
| jobs: | |
| portfolio-optimization: | |
| name: Run ML Pipeline & Sync to Hugging Face | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: 📥 Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🐍 Setup Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: 📦 Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Execute Daily Pipeline | |
| run: | | |
| echo "Starting portfolio analytics pipeline..." | |
| export PYTHONPATH=$PYTHONPATH:. | |
| python src/pipeline/daily_run.py | |
| echo "Pipeline completed successfully" | |
| env: | |
| PYTHONUNBUFFERED: 1 | |
| TZ: Europe/Paris | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| MLFLOW_TRACKING_USERNAME: "SORADATA" | |
| MLFLOW_TRACKING_PASSWORD: ${{ secrets.HF_TOKEN }} | |
| - name: 📊 Detect processed markets | |
| if: always() | |
| id: markets | |
| run: | | |
| MARKETS=$(python -c " | |
| import json, glob | |
| names = [] | |
| for f in sorted(glob.glob('config/markets/*.json')): | |
| try: | |
| with open(f) as fh: | |
| names.append(json.load(fh).get('market_name', 'UNKNOWN')) | |
| except Exception: | |
| pass | |
| print(' & '.join(names)) | |
| ") | |
| echo "list=$MARKETS" >> "$GITHUB_OUTPUT" | |
| - name: 📋 Generate job summary | |
| if: always() | |
| run: | | |
| echo "## AlphaEdge Daily Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Status**: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Run date**: $(date +'%Y-%m-%d %H:%M %Z')" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Market**: ${{ steps.markets.outputs.list }}" >> $GITHUB_STEP_SUMMARY | |
| echo "Check the logs above for detailed performance metrics." >> $GITHUB_STEP_SUMMARY |