feat(landing): auto-refresh live GitHub stars and image-pull stats (#292)

Fetch landing stars + image pulls at build time via a shared stats lib, refreshed by a daily cron + authenticated GITHUB_TOKEN. Image Pulls totals live Docker Hub pull_count + a maintained GHCR estimate (ghcr.io has no public pull-count API).
This commit is contained in:
SnapOtter
2026-06-22 14:11:48 +08:00
committed by GitHub
parent 9b1c105089
commit 33671d2d92
5 changed files with 141 additions and 56 deletions
+8
View File
@@ -5,6 +5,10 @@ on:
branches: [main]
paths:
- "apps/landing/**"
# Daily rebuild so the build-time GitHub stars / Docker Hub pull-count fetches
# refresh even when no landing files changed.
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
concurrency:
@@ -24,6 +28,10 @@ jobs:
- name: Build Landing Page
run: pnpm --filter @snapotter/landing 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/landing/dist --project-name snapotter-landing --branch main --commit-dirty=true