Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

feat(build): refresh app-downloads at build time, drop bot-push workflow#26

Merged
rubenvdlinde merged 1 commit into
developmentfrom
feat/build-time-app-downloads
May 8, 2026
Merged

feat(build): refresh app-downloads at build time, drop bot-push workflow#26
rubenvdlinde merged 1 commit into
developmentfrom
feat/build-time-app-downloads

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Collaborator

Pairs with ConductionNL/.github#46 (already merged) which passes GITHUB_TOKEN to the centralized build step and lets schedule/workflow_dispatch events deploy.

Why

The old .github/workflows/app-downloads.yml ran nightly and tried to git push the regenerated data/app-downloads.json to development. The org-wide PR-required ruleset blocked the bot push (github-actions[bot] can't be added to a ruleset bypass list — only installed Apps appear in the picker), so the data went stale and the homepage showed '0 downloads'.

How

  • prebuild npm script runs the existing Python fetcher (.github/scripts/app_downloads.py) before docusaurus build. JSON is regenerated on every site build, no bot push needed.
  • Cron + dispatch added to local documentation.yml so the site rebuilds nightly at 07:00 UTC even without code changes, picking up fresh download counts each cycle.
  • Drop app-downloads.yml — the bot-push workflow is no longer needed.

Failure mode

If the GitHub API or Nextcloud store is unreachable when the cron fires, the prebuild step fails and the deploy is skipped. The previously-deployed site stays live until the next cron tick (24h max). Acceptable for download counts; preferable to silently shipping stale data.

Verification after merge

  • Watch the next Documentation run on conduction-website (or trigger via gh workflow run documentation.yml -R ConductionNL/conduction-website).
  • Build logs should show the Python script enumerating 331 ConductionNL repos.
  • Homepage download counters should match the new JSON.

The old .github/workflows/app-downloads.yml ran nightly and tried to
git push the regenerated data/app-downloads.json to development.
The org-wide PR-required ruleset blocked the bot push, so the data
went stale and the homepage showed '0 downloads'.

Move the refresh to a Docusaurus prebuild step so the JSON is
regenerated on every site build. No bot push, no rule fight. Add a
nightly cron + workflow_dispatch trigger to documentation.yml so the
site rebuilds daily even without code changes, refreshing the data
each time. Centralized workflow already (PR ConductionNL/.github#46)
passes GITHUB_TOKEN to the build step so the script can authenticate
against the GitHub API and avoid the 60 req/hr unauth ceiling on the
331-repo enumeration.

The committed JSON snapshot stays for local-dev convenience but is
overwritten on every CI build.
@rubenvdlinde rubenvdlinde merged commit 29b0fa7 into development May 8, 2026
3 checks passed
@rubenvdlinde rubenvdlinde deleted the feat/build-time-app-downloads branch May 8, 2026 21:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant