Fix release/S3 pipeline so docs/api and generated reports fully publish to production#3119
Conversation
…ll valid source Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: workflow,ci-cd,deployment,refactor,size-m Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
Fixes production S3/CloudFront publishing drift that caused riksdagsmonitor.com/docs/api/** (and other docs/** assets) to 403 by restoring automatic deploy triggers, ensuring dotfiles (notably .nojekyll) are staged correctly, and making the S3 sync logic extension-agnostic so unexpected file types are still published.
Changes:
- Restore
deploy-s3.ymlauto-deploy onpushtomainand serialize deploys via workflow-levelconcurrency. - Fix
release.ymldocs staging to fully clean/copy directories including dotfiles (cp -r api/.). - Expand
scripts/deploy-s3.shsync coverage (explicit.yml/.yaml/.ts) and add a catch-all final sync pass to upload any remaining files regardless of extension. - Broaden TypeDoc coverage by removing the blanket
**/*.cjsexclusion and includingscripts/**/*.cjsin the typedoc tsconfig.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
typedoc.json |
Removes **/*.cjs and a single-file exclude to increase documented surface while keeping known-broken dashboards excluded. |
tsconfig.typedoc.json |
Includes scripts/**/*.cjs so TypeDoc can process CommonJS script files. |
scripts/deploy-s3.sh |
Ensures .yml/.yaml/.ts get synced and adds an unconditional catch-all sync pass to prevent future 403s from unanticipated extensions/dotfiles. |
.github/workflows/release.yml |
Changes docs cleanup/copy to preserve dotfiles (notably .nojekyll) during release staging. |
.github/workflows/deploy-s3.yml |
Restores push-to-main trigger and adds concurrency to prevent overlapping deploy races. |
| if [ -d "api" ]; then | ||
| cp -r api/* docs/api/ || true | ||
| # `api/.` (not `api/*`) copies dotfiles too — TypeDoc emits | ||
| # `api/.nojekyll` which a bare glob would otherwise skip, | ||
| # silently dropping it from docs/api on every release. | ||
| cp -r api/. docs/api/ || true | ||
| fi |
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
riksdagsmonitor.com/docs/api/**and manydocs/**pages were 403ing because the S3 deploy never ran automatically after a release and the committeddocs/apitree was stale relative to what TypeDoc actually generates (1145 committed files vs. 2361+ produced by a fresh build).Root causes
deploy-s3.ymlhad regressed toworkflow_dispatch-only, contradicting its own documentedpush: branches: [main]trigger (WORKFLOWS.md §4.2) — production S3 never auto-redeployed afterrelease.ymlpushed fresh docs tomain.release.yml's docs staging used shell globs (rm -rf docs/api/*,cp -r api/*) which silently skip dotfiles, dropping TypeDoc's.nojekyll.scripts/deploy-s3.shhad no fallback for file types outside its explicit--includelists (e.g..yml/.ts"media" assets TypeDoc copies fromprojectDocuments), so anything not enumerated 403'd.typedoc.json/tsconfig.typedoc.jsonexcluded**/*.cjsand a single.tsfile from documentation for no functional reason, leaving valid source undocumented.Changes
deploy-s3.yml: restoredpush: branches: [main]trigger alongsideworkflow_dispatch; added aconcurrencygroup so overlapping pushes serialize instead of racing S3 sync / CloudFront invalidation.release.yml: replacedrm -rf dir/*/cp -r api/*withrm -rf dir && mkdir -p dir/cp -r api/.so dotfiles are cleaned and copied correctly.scripts/deploy-s3.sh: added.yml/.yaml/.tsto the metadata sync pass, and replaced the previous type-enumerated catch-all with a fully unconditional final sync pass — every remaining file, any extension, any dotfile, now reaches S3 regardless of whether it was anticipated:typedoc.json/tsconfig.typedoc.json: dropped the blanket**/*.cjsexclude (addedscripts/**/*.cjsto the tsconfiginclude) and the single-file exclude forscripts/strip-in-method-comments.ts— both now document cleanly with 0 build errors. Leftcoalition-dashboard/committees-dashboardexcluded after confirming (via a local build) they carry ~139 pre-existing real TypeScript errors that would break the typedoc job..gitignore's/api/entry is correctly anchored (a prior unanchoredapi/had silently blocked alldocs/api/**commits).