Commit Graph

13 Commits

Author SHA1 Message Date
tiennm99 571a7cd3ac ci: drop miti99bot from champions sync targets 2026-04-22 13:34:47 +07:00
tiennm99 c9d5a0d261 feat(docs): regenerate CHAMPIONS.md from champions.json in scraper
- Add saveMarkdown in markdown.go rendering the Loldle classic-mode column
  table (Champion | Gender | Genre | Range | Resource | Region | Lane | Year).
- main.go writes CHAMPIONS.md after champions.json on every scrape.
- update-champions.yml stages CHAMPIONS.md alongside champions.json so CI
  commits both in lockstep.
- alt text on tile images now uses champion display name (e.g. Bel'Veth)
  instead of the ID slug.
2026-04-21 10:03:07 +07:00
tiennm99 13011a6fad refactor(ci): split scrape and sync into two workflows
- update-champions.yml: cron/manual only, scrapes + commits
  champions.json. Uses LOLDLE_PAT so the push retriggers sync.
- sync-champions.yml: runs on push to champions.json (or manual
  dispatch), fans out to downstream repos via the sync_repo helper.

Single responsibility per workflow; chained via the push trigger.
2026-04-20 21:16:52 +07:00
tiennm99 294bbdfae3 ci: fan out downstream sync on manual pushes too
Add push trigger (paths: champions.json) so direct edits to
champions.json auto-sync to miti99bot and loldle without needing a
workflow_dispatch. Scraper + commit steps skip on push events (the
data is already committed); sync step runs when either changed=true
from the scraper path OR the trigger is push. Default GITHUB_TOKEN
commits don't retrigger workflows, so no self-loop.
2026-04-20 21:14:41 +07:00
tiennm99 9a1a068a90 chore(ci): remove sync-champions.yml — superseded by update-champions.yml fan-out 2026-04-20 21:12:59 +07:00
tiennm99 cab23044e4 refactor(ci): unify downstream sync into one step with shell function
- Single LOLDLE_PAT secret for all downstream repos (miti99bot + loldle).
- sync_repo() takes (repo, dest-path, optional post-copy command);
  add a target by appending one line.
- DRYs up duplicate clone/copy/commit/push blocks.
2026-04-20 21:08:34 +07:00
tiennm99 2eb6b471d8 ci: also push champions data to loldle repo
Mirrors the miti99bot push step — clones tiennm99/loldle, copies
champions.json into public/, commits and pushes. Gated on
LOLDLE_PUSH_TOKEN secret; step is a no-op when unset.
2026-04-20 18:34:32 +07:00
tiennm99 d1dc6d8401 ci: push champions data directly to miti99bot repo
Replaces the repository_dispatch notification flow. After a successful
champions.json commit in loldle-data, this workflow now clones
miti99bot, copies the file, regenerates champions-data.js via the
project's build script, and commits+pushes to miti99bot main.

Token secret renamed MITI99BOT_DISPATCH_TOKEN -> MITI99BOT_PUSH_TOKEN
to reflect the new scope (contents:write on tiennm99/miti99bot).
2026-04-20 18:33:30 +07:00
tiennm99 d9c714831a ci: dispatch miti99bot sync event after champions update
After a successful commit of champions.json, send a repository_dispatch
(type: loldle-data-updated) to tiennm99/miti99bot so its sync workflow
pulls the latest data into its loldle module. No-op when
MITI99BOT_DISPATCH_TOKEN is unset.
2026-04-20 17:10:28 +07:00
tiennm99 0057a037e9 fix: upgrade GitHub Actions to Node.js 24-compatible versions
Bump actions/checkout v4→v5 and actions/setup-go v5→v6 to resolve
Node.js 20 deprecation warnings.
2026-04-16 15:02:05 +07:00
tiennm99 17dff786d9 fix: add write permissions to update-champions workflow
The workflow failed because the default GITHUB_TOKEN lacked write
access, causing `git push` to return 403.
2026-04-16 14:42:05 +07:00
tiennm99 777fc79052 feat: add weekly workflow to auto-update champions data 2026-04-05 12:16:48 +07:00
tiennm99 d44c2ca478 feat: add champions.json sync workflow to loldle repo
Track champions.json in git and add GitHub Action that copies it
to tiennm99/loldle/public/champions.json on push.
2026-04-04 18:41:47 +07:00