Update Seed Data #11
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: Update Seed Data | |
| on: | |
| # Run every Monday at 06:00 UTC (fresh weekly data) | |
| schedule: | |
| - cron: "0 6 * * 1" | |
| # Allow manual trigger from the Actions tab | |
| workflow_dispatch: | |
| inputs: | |
| skip_murlok: | |
| description: "Skip murlok.io fetch (use cached data)" | |
| required: false | |
| default: "false" | |
| type: boolean | |
| skip_bnet: | |
| description: "Skip Battle.net API calls" | |
| required: false | |
| default: "false" | |
| type: boolean | |
| jobs: | |
| update-seed: | |
| name: Fetch & Regenerate Seed Files | |
| runs-on: ubuntu-latest | |
| steps: | |
| # ── Checkout ──────────────────────────────────────────────────────────── | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # ── Python ────────────────────────────────────────────────────────────── | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install -r scripts/requirements.txt | |
| # ── Fetch counter data (murlok.io + static tips) ──────────────────────── | |
| - name: Fetch counter data | |
| env: | |
| BNET_CLIENT_ID: ${{ secrets.BNET_CLIENT_ID }} | |
| BNET_CLIENT_SECRET: ${{ secrets.BNET_CLIENT_SECRET }} | |
| BNET_REGION: eu | |
| run: | | |
| ARGS="" | |
| if [ "${{ github.event.inputs.skip_murlok }}" = "true" ]; then | |
| ARGS="$ARGS --skip-murlok" | |
| fi | |
| if [ "${{ github.event.inputs.skip_bnet }}" = "true" ]; then | |
| ARGS="$ARGS --skip-bnet" | |
| fi | |
| python scripts/fetch_counter_data.py $ARGS | |
| # ── Fetch spec meta + PvP talents (Blizzard Game Data API) ───────────── | |
| - name: Fetch spec meta and PvP talents | |
| if: ${{ github.event.inputs.skip_bnet != 'true' }} | |
| env: | |
| BNET_CLIENT_ID: ${{ secrets.BNET_CLIENT_ID }} | |
| BNET_CLIENT_SECRET: ${{ secrets.BNET_CLIENT_SECRET }} | |
| BNET_REGION: eu | |
| run: python scripts/fetch_bnet_seed.py | |
| continue-on-error: true # don't fail the whole job if Blizzard API is down | |
| # ── Fetch spec baseline (legacy Blizzard API script) ──────────────────── | |
| - name: Fetch spec baseline | |
| if: ${{ github.event.inputs.skip_bnet != 'true' }} | |
| env: | |
| BNET_CLIENT_ID: ${{ secrets.BNET_CLIENT_ID }} | |
| BNET_CLIENT_SECRET: ${{ secrets.BNET_CLIENT_SECRET }} | |
| BNET_REGION: eu | |
| run: python scripts/fetch_blizzard_data.py | |
| continue-on-error: true | |
| # ── Generate spec baseline Lua ─────────────────────────────────────────── | |
| - name: Generate SeedSpecBaseline.lua | |
| if: ${{ github.event.inputs.skip_bnet != 'true' }} | |
| run: python scripts/generate_seed_from_api.py | |
| continue-on-error: true | |
| # ── Regenerate static Lua seed files from curated JSON sources ─────────── | |
| - name: Regenerate seed Lua from JSON sources | |
| run: python scripts/generate_seed_lua.py | |
| # ── Commit if anything changed ─────────────────────────────────────────── | |
| - name: Check for changes | |
| id: diff | |
| run: | | |
| git diff --quiet seed/ || echo "changed=true" >> $GITHUB_OUTPUT | |
| - name: Commit updated seed files | |
| if: steps.diff.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add seed/ | |
| git commit -m "chore(seed): auto-update seed data $(date -u '+%Y-%m-%d')" | |
| git push | |
| - name: No changes | |
| if: steps.diff.outputs.changed != 'true' | |
| run: echo "Seed data is already up to date — nothing to commit." |