Canada Gas Dashboard Hourly Scrape #2084
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: Canada Gas Dashboard Hourly Scrape | |
| on: | |
| schedule: | |
| # Every hour at minute 7 (UTC) | |
| - cron: "7 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: canada-hourly-scrape | |
| cancel-in-progress: false | |
| jobs: | |
| scrape: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| working-directory: Collection/gasgx/gasgx_canadian_natural_gas_data_acquisition_module | |
| env: | |
| PYTHONUNBUFFERED: "1" | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | |
| # Optional fallback if your repo still uses old key name | |
| SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | |
| SUPABASE_TABLE_RUNS: canada_scrape_runs | |
| SUPABASE_TABLE_PAYLOADS: canada_chart_payloads | |
| SUPABASE_TABLE_POINTS: canada_chart_points | |
| SUPABASE_TABLE_ASSETS: canada_chart_assets | |
| SUPABASE_TABLE_TABLES: canada_chart_tables | |
| SUPABASE_TABLE_TABLE_POINTS: canada_chart_table_points | |
| HTTP_TIMEOUT_SECONDS: "30" | |
| CURRENCY: CAD | |
| UNIT: GJ | |
| LOCAL_TIMEZONE: Asia/Shanghai | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.9" | |
| cache: "pip" | |
| cache-dependency-path: Collection/gasgx/gasgx_canadian_natural_gas_data_acquisition_module/requirements.txt | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Verify OCR runtime | |
| run: | | |
| python - <<'PY' | |
| import sys | |
| from rapidocr_onnxruntime import RapidOCR | |
| print("python:", sys.version) | |
| print("rapidocr:", RapidOCR) | |
| PY | |
| - name: Run collector once | |
| run: python collector.py --once |