Orchestrator Auto #18
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: Orchestrator Auto | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "17 8 * * *" # 08:17 UTC daily (03:17 America/Detroit) - auto mode | |
| - cron: "47 20 * * *" # 20:47 UTC daily (15:47 America/Detroit) - auto mode | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| scrape: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Install Playwright | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Checkout existing data | |
| run: | | |
| git fetch origin data:data 2>/dev/null || true | |
| if git show-ref --verify --quiet refs/heads/data; then | |
| git checkout data -- data/ 2>/dev/null || true | |
| git checkout dev | |
| fi | |
| - name: Run orchestrator | |
| env: | |
| DATA_ROOT: ${{ github.workspace }}/data | |
| ORCH_CONCURRENCY: 2 | |
| ORCH_RETRIES: 2 | |
| GITHUB_SHA: ${{ github.sha }} | |
| GITHUB_RUN_ID: ${{ github.run_id }} | |
| run: | | |
| node orchestrate.js run auto | |
| - name: Upload data artifact | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scraped-data | |
| path: data/** | |
| retention-days: 1 | |
| commit: | |
| needs: scrape | |
| runs-on: ubuntu-latest | |
| if: success() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: dev | |
| fetch-depth: 0 | |
| - name: Download data artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: scraped-data | |
| path: data/ | |
| - name: Configure git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Commit and push data | |
| run: | | |
| # Switch to data branch (create if doesn't exist) | |
| git fetch origin data:data 2>/dev/null || git checkout -b data | |
| git checkout data | |
| # Add and commit data | |
| git add -f data/ | |
| if git diff --staged --quiet; then | |
| echo "No data changes to commit" | |
| else | |
| git commit -m "🤖 Auto-scrape $(date -u '+%Y-%m-%d %H:%M UTC') | |
| Orchestration ID: $(cat data/orchestrations/*/*/manifest.json | jq -r '.orchestration.id' | tail -1) | |
| 🤖 Generated with GitHub Actions | |
| Co-Authored-By: github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | |
| # Push to data branch | |
| git push -u origin data | |
| fi |