name: Demo on: push: branches: [main] paths-ignore: - "demo/**" - "**.md" - "LICENSE" workflow_dispatch: permissions: contents: write concurrency: group: demo cancel-in-progress: true jobs: generate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: "1.26" cache: true - name: Build ghstats run: go build -trimpath -ldflags="-s -w" -o ghstats . - name: Render every card for every theme env: GITHUB_TOKEN: ${{ secrets.GHSTATS_TOKEN }} run: | rm -rf demo mkdir -p demo ./ghstats \ -user "${{ github.repository_owner }}" \ -themes all \ -tz Asia/Saigon \ -out demo - name: Write demo READMEs (index + per-theme) env: OWNER: ${{ github.repository_owner }} REPO: ${{ github.repository }} run: | themes=$(./ghstats -list-themes) # Lightweight index so readers don't have to load ~975 images at once. { echo "# ghstats demo gallery" echo echo "Every card rendered for [\`$OWNER\`](https://github.com/$OWNER) in every supported theme. Click a theme to open its gallery page — each page embeds 15 SVGs, so only the theme you're reviewing is fetched." echo echo "Auto-generated by [\`.github/workflows/demo.yml\`](../.github/workflows/demo.yml) on each push to \`main\`. Do not edit by hand." echo echo "## Themes" echo for theme in $themes; do dir="demo/$theme" [ -d "$dir" ] || continue echo "- [\`$theme\`](./$theme/README.md)" done } > demo/README.md # Per-theme page groups singletons at top, then compares last-year # vs all-time variants side-by-side so the reader can eyeball the # evolution of each metric without scrolling. for theme in $themes; do dir="demo/$theme" [ -d "$dir" ] || continue out="$dir/README.md" pair() { local heading="$1" left="$2" right="$3" [ -f "$dir/$left.svg" ] && [ -f "$dir/$right.svg" ] || return printf '### %s\n\n' "$heading" printf '
| Last year | All time |
|---|---|