Skip to content

docs(ci): Publish to libtmux.org alongside git-pull.com - #756

Open
tony wants to merge 8 commits into
docs-sitefrom
docs-site-deploy
Open

docs(ci): Publish to libtmux.org alongside git-pull.com#756
tony wants to merge 8 commits into
docs-sitefrom
docs-site-deploy

Conversation

@tony

@tony tony commented Sep 6, 2026

Copy link
Copy Markdown
Member

Stacked on #755 — review that one first. This branch is #755 plus the deploy work.

Additive: libtmux.git-pull.com keeps publishing exactly as it does today, and libtmux.org is added alongside it. Nothing stops updating when this merges.

Summary

  • Add a second publish, to libtmux.org under en/py/latest/, through libtmux/docs's shared reusable-deploy.yml — the same workflow every port calls, which writes only that port's own prefix.
  • Build twice. The two destinations need different bytes, not one artifact published to both.
  • Keep libtmux.git-pull.com's publish byte-for-byte as it is on master, running inside its own build job.
  • Separate the secrets: LIBTMUX_ORG_* for the new destination, LIBTMUX_DOCS_* left meaning exactly what it means today.
  • Move the paths-filter gate into its own job, so one output feeds both publishes instead of the condition being repeated on every step.

Why two builds and not one artifact twice

libtmux.git-pull.com libtmux.org
Served at bucket root en/py/latest/
/_shell/shell.js nothing there the site's chrome
/search/ this build's own search page the site-wide Pagefind search
Build LIBTMUX_DOCS_STANDALONE=1 flag unset

One artifact published to both is wrong in one direction or the other: set the flag and libtmux.org gets an unskinned nested site with the wrong search; unset it and git-pull.com gets a /search/ that redirects to itself. tests/test_docs_conf.py pins both shapes, including the empty-string form the matrix passes.

The git-pull.com sync stays inside its build job rather than moving behind an artifact. It is a live site, and upload-artifact does not preserve the symlinks that sync is explicitly told to follow.

Secrets

Set, and verified present on the repository — three for each destination:

Secret Destination
LIBTMUX_ORG_ROLE_ARN, LIBTMUX_ORG_BUCKET, LIBTMUX_ORG_DISTRIBUTION libtmux.org
LIBTMUX_DOCS_ROLE_ARN, LIBTMUX_DOCS_BUCKET, LIBTMUX_DOCS_DISTRIBUTION libtmux.git-pull.com, untouched

The role trusts repo:tmux-python/libtmux:environment:docs — the name-only subject, which this repo can use because it predates GitHub's 2026-07-15 immutable-subject cutoff.

Still unset, and worth doing before or soon after this merges: the docs environment has no protection rules. A deployment branch-and-tag policy (master, v*) is what actually restricts which refs may publish, since environment: rewrites the OIDC sub claim to drop any ref: clause.

Verification, and its limit

docs.yml triggers only on push to master, so no PR check exercises any of this. First execution is the merge. What I could check instead:

  • The four git-pull.com publish steps are byte-equivalent to master's — compared as parsed YAML, not by eye
  • path-prefix: py/latest publishes to en/py/latestreusable-deploy.yml prepends $locale/ whenever port is set, so passing en/py/latest would double it
  • py/latest passes that workflow's own prefix validation: unrooted, no .., not a bare reserved top-level name
  • Every required input and secret is supplied, checked against the workflow_call block rather than against the example
  • version-kind: trunk is one of the kinds it accepts
  • The artifact lands where it expects: it downloads to dist/ and syncs dist/, so the tree must be at the artifact root — path: docs/_build/html gives that
  • The pinned commit's reusable-deploy.yml parses identically to the previously pinned one — its diff is comments only, compared as parsed YAML rather than read
  • concurrency.queue is valid despite actionlint 1.7.12 rejecting it: it is in GitHub's published workflow schema, and deploy-shell.yml in libtmux/docs uses it with successful runs. That is actionlint lagging, and it is the only diagnostic it reports on this file
  • Either deploy, end to end. Not observable before merge

One departure from the documented recipe

reusable-deploy.yml's header asks callers to pin a tag. This pins a commit, with the release named in a trailing comment — the form Dependabot reads to offer a bump.

libtmux/docs has cut and deleted v1 and v2, and its replacement is a 0.x prerelease series documented as moving. This uses: runs another repository's workflow inside this one, with id-token: write and a role that can write the bucket, so a ref that can be repointed means what executes here changes with no diff in this repository and no review. A commit cannot be repointed. The pinned commit is the one the deleted v2 pointed at, and its reusable-deploy.yml is byte-identical to every other candidate.

This is deliberately unlike the rest of the file, which pins moving majors (actions/checkout@v7, actions/cache@v6). Those are first-party actions running with this workflow's own permissions; this one runs a third party's workflow with id-token: write and bucket-write credentials, which is the case the pinning guidance is actually about.

Note the trailing comment is documentation here, not automation: this repository has no .github/dependabot.yml, so nothing will offer the bump. Bumping is manual until one exists.

The Cloudflare purge stays, unlike the previous revision of this branch — it fronts libtmux.git-pull.com, which is still being published.

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.45%. Comparing base (1aae8a6) to head (16ec75d).

Additional details and impacted files
@@              Coverage Diff              @@
##           docs-site     #756      +/-   ##
=============================================
+ Coverage      52.37%   52.45%   +0.08%     
=============================================
  Files             26       26              
  Lines           3729     3729              
  Branches         747      747              
=============================================
+ Hits            1953     1956       +3     
+ Misses          1472     1469       -3     
  Partials         304      304              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony changed the title docs(ci): Publish to libtmux.org under this port's prefix docs(ci): Publish to libtmux.org alongside git-pull.com Sep 6, 2026
@tony
tony marked this pull request as ready for review September 6, 2026 11:36
tony and others added 8 commits September 6, 2026 09:50
why: The sync wrote the whole bucket root with --delete, which is the
shape libtmux.org's per-port prefixes exist to prevent, and it left the
Python docs outside the site: every /en/py/<version>/ URL 403s because
no port tree has been published. libtmux/docs is public as of today, so
its reusable deploy workflow can be called from here.

what:
- Split the job: build uploads docs/_build/html, publish calls
  libtmux/docs reusable-deploy.yml and deploys only en/py/latest
- Pass path-prefix unprefixed by locale; the workflow prepends it
- Add the workflow-level concurrency group every caller must set
- Drop LIBTMUX_DOCS_STANDALONE: the tree is nested now, so the shell's
  chrome and site-wide search are reachable and belong on
- Pin the reusable workflow to a commit rather than a moving branch
why: The SHA pin stood in for a tag that did not exist when this was
written; libtmux/docs has since tagged v1, which is the ref its own
header asks callers to use and bump on review.

what:
- Point the publish job at @v1, whose reusable-deploy.yml is
  byte-identical to the commit it replaces
why: The previous shape moved the publish, which would have stopped
libtmux.git-pull.com updating the moment it merged. Serving both costs
one more build and leaves a failure on the new side with no effect on
the old one.

what:
- Build twice: the two sites need different bytes, not one artifact
  published to both. git-pull.com is served at a root and is built
  standalone; libtmux.org nests at en/py/latest and carries the shell
- Publish git-pull.com from inside its own build, exactly as before,
  rather than behind an artifact that would not keep its symlinks
- Give libtmux.org its own LIBTMUX_ORG_* secrets, leaving LIBTMUX_DOCS_*
  meaning what it means today
- Move the paths-filter gate into its own job, so one output feeds both
  and no step repeats the condition
- Pin the shared workflow to v2
why: libtmux/docs deleted v1 and v2, so the `@v2` here resolved to
nothing and this workflow could not have started. Its replacement is a
0.x prerelease series documented as moving, and a ref that can be
repointed changes what executes in this repository — with
`id-token: write` and a role that can write the bucket — without a diff
here or a review.

what:
- Pin the commit the deleted tag pointed at, whose reusable-deploy.yml
  is byte-identical to both deleted tags
- Name the release it belongs to in a trailing comment, which is the
  form Dependabot reads to offer a bump
why: libtmux/docs has settled its convention — callers pin a full-length
commit and name the release beside it — and the commit carrying that is
the one to depend on. Its reusable-deploy.yml differs from the pinned
one in comments only; the parsed workflow is identical.

what:
- Pin e30bcba4, which tag v0.1.0-alpha.1 names
- Correct this comment: it claimed Dependabot would offer the bump, and
  nothing here will, since the repository has no dependabot.yml
/en/py/latest/ 403s on libtmux.org — nothing has published under a port
version prefix. This lets the branch publish without merging, which also
sidesteps the base-branch problem: this PR targets docs-site, so merging
it would trigger nothing.

Repinned to ce9d7ed, which fixes the manifest upsert: jq precedence made
it add an array to an object, so every publish failed after syncing. Found
on the first real run, from libtmux-rs.

libtmux.git-pull.com is unaffected — its leg publishes in the job before.

Drop docs-site-deploy from the trigger when merging to master.
/en/py/latest/ was serving Furo, and /en/py/latest/concepts/ 403'd — so
the port switcher was broken for Python from every shared page.

The libtmux.org leg uploaded docs/_build/html, on the assumption that the
Sphinx site is this port's tree. It is not: en/py/latest/ is the shared
shell rendered with Python's code fences, and the gp-sphinx output belongs
at en/py/latest/api/ inside it. Publishing Sphinx to the prefix replaced
the whole tree, api and all.

That leg now runs libtmux/docs's build-site.sh, which renders the shell
and runs sphinx itself from this checkout, and uploads the assembled
en/py/latest. Without --skip-refs, because Python's api/ is the real
render rather than the redirect stub every other port gets — it is what
check-style-parity.mjs measures against.

libtmux.git-pull.com is untouched: its leg still builds standalone and
publishes in-job, before this one runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant