Skip to content

Catalog

Catalog #56

Workflow file for this run

# Catalog automation for production (Railway Postgres).
# Secrets: DATABASE_URL (Railway DATABASE_PUBLIC_URL), FRED_API_KEY
name: Catalog
on:
schedule:
- cron: "0 3 * * 0" # weekly metadata sync (Sun 03:00 UTC)
- cron: "0 4 * * *" # daily grow (04:00 UTC)
workflow_dispatch:
inputs:
job:
description: Which job to run
required: true
default: sync
type: choice
options:
- sync
- sync-nyc
- grow
- both
concurrency:
group: catalog-${{ github.event.schedule || github.event.inputs.job || 'manual' }}
cancel-in-progress: false
env:
# Prod-sized caps (Hobby / ~$5 budget). Override via repo variables if needed.
CKAN_SYNC_MAX_INDEXED: "3000"
CKAN_SYNC_MAX_PACKAGES: "300"
CKAN_SYNC_ROWS: "100"
CKAN_SYNC_MAX_PAGES: "20"
WB_SYNC_MAX_INDEXED: "5000"
WB_SYNC_MAX_INDICATORS: "2000"
WB_SYNC_MAX_PER_FAMILY: "2"
WB_SYNC_MAX_PER_TOPIC: "250"
FRED_SYNC_MAX_INDEXED: "500"
FRED_SYNC_MAX_SERIES: "200"
CATALOG_PROBE_ENABLED: "true"
CATALOG_SYNC_PRUNE_ENABLED: "false"
CATALOG_PROBE_BATCH_SIZE: "100"
CATALOG_SYNC_INTERVAL_HOURS: "0"
CATALOG_PROBE_INTERVAL_HOURS: "0"
NYC_SYNC_MAX_INGESTIBLE: "50"
NYC_SYNC_MAX_INDEXED: "150"
jobs:
sync:
if: >-
github.event.schedule == '0 3 * * 0' ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.job == 'sync' || github.event.inputs.job == 'both'))
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: apps/api/pyproject.toml
- name: Install API
run: pip install ./apps/api
- name: Full catalog sync
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
run: python -m findings_api.catalog.cli sync
sync-nyc:
if: >-
github.event_name == 'workflow_dispatch' &&
github.event.inputs.job == 'sync-nyc'
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: apps/api/pyproject.toml
- name: Install API
run: pip install ./apps/api
- name: NYC Open Data catalog sync
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: python -m findings_api.catalog.cli sync-nyc
grow:
if: >-
github.event.schedule == '0 4 * * *' ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.job == 'grow' || github.event.inputs.job == 'both'))
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: apps/api/pyproject.toml
- name: Install API
run: pip install ./apps/api
- name: Daily catalog grow
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
run: python -m findings_api.catalog.cli grow