name: Run Reddit Pipeline on: schedule: - cron: '0 3 * * *' # Runs daily at 03:00 UTC workflow_dispatch: inputs: user_input_override: description: 'Optional raw text to process instead of Reddit fetch' required: false default: '' jobs: run-pipeline: runs-on: ubuntu-latest timeout-minutes: 10 env: PYTHONUNBUFFERED: '1' OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} BRIGHTDATA_API_KEY: ${{ secrets.BRIGHTDATA_API_KEY }} SUPABASE_URL: ${{ secrets.SUPABASE_URL }} SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} REDDIT_USER_AGENT: 'Mozilla/5.0' steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' - name: Cache pip uses: actions/cache@v4 with: path: ~/.cache/pip key: pip-${{ runner.os }}-${{ hashFiles('backend/requirements.txt') }} restore-keys: | pip-${{ runner.os }}- - name: Install dependencies working-directory: backend run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Run rd_pipeline (Reddit fetch mode or manual override) working-directory: backend env: USER_INPUT_OVERRIDE: ${{ github.event.inputs.user_input_override || '' }} run: python rd_pipeline_bdata.py - name: Summarize run if: always() run: | echo 'Run complete at:' $(date -u)