Generate Summary Reports #4
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: Generate Summary Reports | |
on: | |
schedule: | |
# Generate summary reports daily at 5 AM Eastern (9 AM UTC) | |
- cron: '0 9 * * *' | |
workflow_dispatch: | |
inputs: | |
generate_all_reports: | |
description: 'Generate all summary reports' | |
required: false | |
default: 'true' | |
type: boolean | |
env: | |
PYTHON_VERSION: 3.13 | |
jobs: | |
generate-summary-reports: | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: π Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pip' | |
- name: π¦ Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install linear-api | |
- name: π Generate Summary Reports | |
env: | |
SUPABASE_URL_PROD: ${{ secrets.SUPABASE_URL_PROD }} | |
SUPABASE_KEY_PROD: ${{ secrets.SUPABASE_KEY_PROD }} | |
SUPABASE_DATA_URL: ${{ secrets.SUPABASE_DATA_URL }} | |
SUPABASE_DATA_KEY: ${{ secrets.SUPABASE_DATA_KEY }} | |
COINGECKO_KEY: ${{ secrets.COINGECKO_KEY }} | |
GOOGLE_CLOUD_KEY: ${{ secrets.GOOGLE_CLOUD_KEY }} | |
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }} | |
run: | | |
echo "π Starting summary reports generation..." | |
python scripts/generate_summary_reports.py | |
echo "β Summary reports generation completed" | |
- name: π€ Upload Summary Reports | |
uses: actions/upload-artifact@v4 | |
with: | |
name: summary-reports-${{ github.run_id }} | |
path: | | |
bridge_summary_*.md | |
musd_summary_*.md | |
market_summary_*.md | |
pools_summary_*.md | |
swaps_summary_*.md | |
vaults_summary_*.md | |
retention-days: 30 | |
notify-on-failure: | |
runs-on: ubuntu-latest | |
if: always() && contains(needs.*.result, 'failure') | |
needs: [generate-summary-reports] | |
steps: | |
- name: π± Discord notification on failure | |
run: | | |
curl -X POST -H "Content-Type: application/json" \ | |
-d '{ | |
"embeds": [{ | |
"title": "π¨ Summary Reports Generation Failed", | |
"description": "Summary reports generation failed in `${{ github.repository }}`", | |
"color": 15158332, | |
"fields": [ | |
{ | |
"name": "Workflow", | |
"value": "${{ github.workflow }}", | |
"inline": true | |
}, | |
{ | |
"name": "Branch", | |
"value": "${{ github.ref_name }}", | |
"inline": true | |
}, | |
{ | |
"name": "Triggered by", | |
"value": "${{ github.event_name }}", | |
"inline": true | |
}, | |
{ | |
"name": "View Logs", | |
"value": "[Run #${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})", | |
"inline": false | |
} | |
], | |
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" | |
}] | |
}' \ | |
${{ secrets.DISCORD_WEBHOOK }} |