githubnext / githubnext/gh-aw-cao

[self-care:docs-build-time-investigator] Reduce unnecessary 15-minute docs Pages rebuilds when caches are already warm

Closed
#3,426 0 comments 0 reactions 0 assignees View on GitHub
self-care self-care:docs-build-time-investigator
Dominant language
JavaScript
Stars
3
Forks
1
Avg merge
49m
Merged PRs (30d)
837

Description

The Documentation Pages workflow is rebuilding and redeploying on a 15-minute schedule even though its caches are already warm and the actual docs build is cheap. Across 16 successful runs from 2026-09-06T05:45:58Z to 2026-09-06T10:30:50Z, median end-to-end time was 84.5s (p90 105.5s); only 5.0s of the `build` job median was `npm run docs:build`, while the scheduled `dashboard` dispatch plus downstream dashboard-build workflow accounted for about 64.5s combined median. The evidence points to avoidable rebuild frequency, not a missing dependency cache.

### Summary
The current schedule rebuilds and redeploys Pages every 15 minutes even when only dashboard activity data changes. In the observed sample, dependency caches hit consistently, so the dominant recurring cost is orchestration and dashboard regeneration, not package installation. The most effective improvement is to stop running `docs.yml` on every 15-minute tick for content that does not require a full Pages rebuild.

### Timing evidence
- Evidence window: 2026-09-06T05:45:58Z to 2026-09-06T10:30:50Z
- Comparable successful `docs.yml` runs analyzed: 16 scheduled/push completions within the latest 20 completed runs and last 14 days
- Excluded runs: 4 failed scheduled runs (`34024870952`, `34024446268`, `34023480929`, `34022762568`) from normal timing aggregates
- Full `docs.yml` workflow: median 84.5s, p90 105.5s
- Queue time before first job: median 3.0s, p90 4.0s
- `dashboard` job in `docs.yml`: median 36.5s, p90 50.0s
- `build` job in `docs.yml`: median 27.0s, p90 32.0s
- `deploy` job in `docs.yml`: median 9.5s, p90 10.0s
- Dispatched `dashboard-build.yml` workflow: median 28.0s, p90 38.0s
- `activity` job: median 5.0s, p90 6.0s
- `build` job: median 13.5s, p90 18.5s
- Representative repeated step medians from successful runs:
- `Set up Node.js`: 5.0s
- `Restore node_modules`: 5.0s
- `Build documentation`: 5.0s
- `Dispatch dashboard build`: 33.0s
- Dashboard-build `Upload dashboard artifact`: 2.0s
- `Deploy Pages`: 6.0s
- Cache verification from run metadata/logs:
- `Install dependencies` and `Save node_modules` were skipped in all 16 successful `docs.yml` samples, indicating `node_modules` cache hits
- `Check for a cached activity snapshot` succeeded and `Dispatch activity refresh` was skipped in all 16 sampled `dashboard-build.yml` runs, indicating cache-backed dashboard input reuse in `cache` mode

### Bottleneck
The bottleneck is avoidable workflow frequency and orchestration overhead. The scheduled run dispatches `dashboard-build.yml`, waits for a cached dashboard artifact, then uploads and deploys Pages even though the docs build itself is only about 5 seconds and dependency installation is already eliminated by cache hits. Roughly 64.5 seconds of the 84.5-second median comes from the `dashboard` job plus the downstream dashboard-build workflow, leaving little room for further dependency-cache gains.

### Recommended changes
1. Change `.github/workflows/docs.yml` so the 15-minute schedule no longer triggers a full Pages rebuild when only activity/dashboard freshness is needed.
2. Keep `push`-based docs deployments for source changes under `docs/**`, dashboard site sources, workflow sources that affect generated output, and lock/manifests already listed in `paths`.
3. Move dashboard freshness updates to the reusable `dashboard-build.yml` cadence alone, or reduce `docs.yml` scheduled frequency to a slower interval that matches acceptable Pages freshness.
4. If a scheduled docs deployment must remain, add an early change-detection gate before dispatching `dashboard-build.yml` so the workflow exits without build/deploy when no documentation-facing inputs changed.

Relevant source locations:
- `.github/workflows/docs.yml`: `schedule`, `dashboard`, `build`, and `deploy` jobs
- `.github/workflows/dashboard-build.yml`: cache-backed `activity` and dashboard artifact generation path

### Expected effect and validation
- Expected savings: about 64.5s per avoided scheduled run, or ~76% of the current 84.5s median `docs.yml` runtime, which exceeds the 60s / 15% actionability threshold.
- Why confidence is high: 16 comparable successful runs on the same head SHA showed warm dependency caches and repeated low docs-build cost, while dispatch/orchestration remained the dominant cost.
- Validate by:
1. comparing the next 10 successful runs after the schedule/gating change,
2. confirming fewer `docs.yml` schedule executions reach `dashboard`, `build`, and `deploy`, and
3. checking that push-triggered content updates still publish correctly and dashboard freshness remains acceptable.

### Caveats
- This recommendation optimizes total build time and Actions consumption, not the inner `npm run docs:build` step, because the current evidence does not show a dependency-cache bottleneck.
- If stakeholders require the Pages site itself to reflect fresh dashboard data every 15 minutes, reducing schedule frequency trades freshness for lower build time; that freshness requirement should be confirmed before changing cadence.
- Four failed scheduled runs were excluded from the timing aggregate but should still be reviewed separately because they may affect reliability even if they do not change the dominant cost pattern.

### Control Plane
- Correlation ID: `34027470295-278`
- Central repository: `githubnext/gh-aw-cao`
- Control plane run: `https://github.com/githubnext/gh-aw-cao/actions/runs/34027470295`

### References
- `docs.yml` runs:
- https://github.com/githubnext/gh-aw-cao/actions/runs/34027627177
- https://github.com/githubnext/gh-aw-cao/actions/runs/34027148175
- https://github.com/githubnext/gh-aw-cao/actions/runs/34026264321
- https://github.com/githubnext/gh-aw-cao/actions/runs/34025551583
- https://github.com/githubnext/gh-aw-cao/actions/runs/34022357442
- https://github.com/githubnext/gh-aw-cao/actions/runs/34021880025
- https://github.com/githubnext/gh-aw-cao/actions/runs/34020741734
- https://github.com/githubnext/gh-aw-cao/actions/runs/34020028237
- Dispatched `dashboard-build.yml` runs:
- https://github.com/githubnext/gh-aw-cao/actions/runs/34027634511
- https://github.com/githubnext/gh-aw-cao/actions/runs/34027153961
- https://github.com/githubnext/gh-aw-cao/actions/runs/34026271247
- https://github.com/githubnext/gh-aw-cao/actions/runs/34025558092
- https://github.com/githubnext/gh-aw-cao/actions/runs/34022363943
- https://github.com/githubnext/gh-aw-cao/actions/runs/34021885040
- https://github.com/githubnext/gh-aw-cao/actions/runs/34020749300
- https://github.com/githubnext/gh-aw-cao/actions/runs/34020033990

> Generated by [SelfCare / Docs Build Time](https://github.com/githubnext/gh-aw-cao/actions/runs/34027626809) · pi · gpt54 · 45.3 AIC · ⌖ 8.57 AIC · ⊞ 8.7K · [◷](https://github.com/search?q=repo%3Agithubnext%2Fgh-aw-cao+is%3Aissue+%22gh-aw-workflow-call-id%3A+githubnext%2Fgh-aw-cao%2Fself-care-docs-build-time-investigator%22&type=issues)
> - [x] expires on Sep 20, 2026, 10:37 AM UTC

Contributor guide

Open the contributing guide

Research direction

Start by reading the schedule, dashboard, build, and deploy jobs in .github/workflows/docs.yml, then trace the cache-backed activity and artifact path in .github/workflows/dashboard-build.yml. Confirm the required dashboard freshness before choosing a slower schedule or change-detection gate; done means avoiding unnecessary scheduled Pages work while push-triggered docs updates still deploy and dashboard freshness remains acceptable.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd, devops
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.