Repository navigation
Commit 4dbfaff
[Change] Publish the docs site per release, not on every trunk push (#487)
## Why
The published guide at
https://wordpress.github.io/contributor-toolkit/guide/getting-started.html
is built from trunk on every push that touches `docs/`. Merging the
Gutenberg stack therefore put five unreleased features in front of
users: the latest release is v1.1.0, and nothing anyone can download has
"Working on a GitHub issue", the Gutenberg site type, or the Gutenberg
PR panel.
This is not a docs mistake. Docs shipping in the same PR as the change
they describe is the rule here, and the consequence of that rule is that
trunk's guide is always ahead of the newest build. What was wrong is
publishing trunk.
## What changes
The site now tracks the latest **release**. Deploy runs only on
`workflow_dispatch`, with a required `ref` input naming what to publish,
so cutting a release advances the guide with one command:
```bash
gh workflow run docs.yml --ref trunk -f ref=v1.2.0
```
Two decisions a reviewer would otherwise have to reverse-engineer:
**Why the ref is an input rather than the dispatch target.** Dispatching
on tag `v1.1.0` would run the copy of `docs.yml` that exists *at that
tag*, whose deploy job is gated on `github.ref == 'refs/heads/trunk'`.
It would build and silently skip the deploy. So the dispatch happens on
trunk and the ref to publish travels as an input.
**Why the deploy guard still tests `github.ref`.** It means something
narrower now, and the comment says so: it decides which copy of this
workflow may hold the Pages OIDC token (the reviewed, merged one), not
what gets published. `inputs.ref` decides that, and publishing an
arbitrary ref is the point. The `github-pages` environment already has a
deployment-branch policy allowing only `trunk`, so this is belt and
braces.
Pushes to trunk and pull requests still build, they just never deploy: a
dead link fails when it is proposed and again when it lands, rather than
at release time.
Not in this PR: any change to `docs/` content. Trunk's guide stays as it
is and goes live at v1.2.0.
## How to test this
Platform: any. This is CI-only, nothing in the app changes.
**Starting state:** this branch, and the repo's Actions tab.
1. Open this PR's **Docs** check. Expected: the `build site` job runs
and passes; **no** `deploy to Pages` job appears. The old behaviour was
the same for PRs, so this confirms nothing regressed.
2. In the run's summary page, look at the **Record what was built**
step's output. Expected: a "Built `<sha>`" line naming the commit, and
no "Not published" warning (that warning is for dispatches only).
3. After merge, go to Actions → Docs → **Run workflow**. Expected: a
**"Git ref to publish"** box, required, with no prefilled value.
4. Run it with branch `trunk` and ref `v1.1.0`. Expected: build passes,
`deploy to Pages` runs, the run summary names `v1.1.0` and commit
`576d218`, and the live guide loses the Gutenberg pages: no "Working on
a GitHub issue" in the sidebar, and `/guide/gutenberg-issues.html` 404s.
5. The sharp-edge path: run it with branch `v1.1.0` (the tag) instead of
trunk. Expected: it builds, the deploy is skipped, and the run summary
carries a "1 parent c91908c commit 4dbfaff
2 files changed
Lines changed: 83 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
6 | 18 | | |
7 | 19 | | |
8 | 20 | | |
| |||
15 | 27 | | |
16 | 28 | | |
17 | 29 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| |||
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
36 | 53 | | |
37 | 54 | | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
44 | 64 | | |
45 | | - | |
| 65 | + | |
46 | 66 | | |
47 | 67 | | |
48 | 68 | | |
| |||
54 | 74 | | |
55 | 75 | | |
56 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
57 | 82 | | |
58 | 83 | | |
59 | 84 | | |
| |||
77 | 102 | | |
78 | 103 | | |
79 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
80 | 136 | | |
81 | 137 | | |
82 | 138 | | |
83 | 139 | | |
84 | 140 | | |
85 | 141 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
90 | 155 | | |
91 | 156 | | |
92 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| |||
0 commit comments