mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user