fix(landing,docs): use build-time GitHub star count, drop per-page api.github.com fetch (#560)

Removes the client-side api.github.com fetch from the landing navbar and the docs theme; both now render a build-time star count (docs via a new VitePress data loader). deploy-docs.yml gets GITHUB_TOKEN plus a daily refresh cron, mirroring deploy-landing.yml. Fixes #555.
This commit is contained in:
SnapOtter
2026-07-18 10:45:28 +08:00
committed by GitHub
parent d4eaa655b2
commit 54073a7c50
4 changed files with 73 additions and 52 deletions
+9
View File
@@ -5,6 +5,11 @@ on:
branches: [main]
paths:
- "apps/docs/**"
# Daily rebuild so the build-time GitHub star count refreshes even when no
# docs files changed (mirrors deploy-landing.yml, offset an hour so the two
# scheduled deploys don't fire at once).
schedule:
- cron: "0 8 * * *"
workflow_dispatch:
concurrency:
@@ -24,6 +29,10 @@ jobs:
- name: Build Docs
run: pnpm --filter @snapotter/docs docs:build
env:
# Authenticated GitHub API (5,000 req/hr) so the build-time star-count
# fetch isn't rate-limited on shared runner IPs (60 req/hr unauth).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Cloudflare Pages
run: npx wrangler pages deploy apps/docs/.vitepress/dist --project-name snapotter-docs --branch main --commit-dirty=true