oilverse-api / .github /workflows /update_data.yml
孙家明
deploy: OilVerse for HuggingFace (Node.js 18 fix)
fab9847
name: 月度数据更新 (CFTC/WorldBank/Census)
# 每月1日和15日自动运行,也可手动触发
on:
schedule:
- cron: '0 8 1,15 * *' # UTC 08:00 = 北京时间 16:00
workflow_dispatch: # 支持手动触发
jobs:
update-data:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install pandas requests openpyxl xlrd
- name: Fetch World Bank Commodities
run: |
python scripts/fetch_worldbank.py
- name: Fetch CFTC Positioning
run: |
python scripts/fetch_cftc.py
- name: Fetch US Census Trade
run: |
python scripts/fetch_census.py
- name: Commit updated data
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/cloud/*.csv
git diff --cached --quiet || git commit -m "auto: monthly data update $(date +%Y-%m-%d)"
git push