@norskvideo/ctl-dev-kit 0.2.93 → 0.2.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/conventions/docs-site.md
CHANGED
|
@@ -177,9 +177,9 @@ ln -s ../../../../../docs/generated/<slug> website/src/content/docs/guides/<slug
|
|
|
177
177
|
|
|
178
178
|
`docs:site` runs the dev-kit's `docs/guide-stubs.ts stub` first, so the site
|
|
179
179
|
builds on a checkout that has never captured. The captures come from the
|
|
180
|
-
product's nightly `publish-docs.yml`, which
|
|
181
|
-
|
|
182
|
-
the newest
|
|
180
|
+
product's nightly `publish-docs.yml`, which keeps `docs/generated` as the
|
|
181
|
+
`docs-captures` artifact after a passing engine tier; `publish-docs-site.yml`
|
|
182
|
+
downloads the newest one before its build (and runs when `publish-docs` completes, so a
|
|
183
183
|
fresh capture publishes without waiting for a push). It then runs
|
|
184
184
|
`guide-stubs.ts check` and refuses to deploy while any guide is still a
|
|
185
185
|
placeholder: until the guide has been captured once, the publish stops rather
|
|
@@ -214,9 +214,11 @@ where the repo has a site and is not a turnkey. On every push to `main` (and on
|
|
|
214
214
|
demand) it installs `website/`, builds the public variant and deploys
|
|
215
215
|
`website/dist-public` to Cloudflare Pages with `wrangler`. It never cancels a
|
|
216
216
|
run in flight, because a cancelled deploy is a half-published site. Before the
|
|
217
|
-
build it
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
build it downloads the newest recorded-guide captures (the `docs-captures`
|
|
218
|
+
artifact `publish-docs.yml` keeps for 30 days, not the Actions cache, whose
|
|
219
|
+
entries are versioned by a compression that varies across runners); a site
|
|
220
|
+
with no recorded guides restores nothing it reads, and builds from its
|
|
221
|
+
committed prose.
|
|
220
222
|
|
|
221
223
|
Where it may exist is the gate's business (ADR-0012, and the documentation
|
|
222
224
|
plan): a repo with `website/astro.config.mjs` may carry it; a repo without a
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# rides every push (conventions/docs-site.md, "Two documentation channels").
|
|
9
9
|
# A site that also symlinks RECORDED guides (website/src/content/docs/guides/
|
|
10
10
|
# <slug> -> docs/generated/<slug>) publishes them from the captures that nightly
|
|
11
|
-
# run
|
|
11
|
+
# run keeps as an artifact: they are restored before the build, which
|
|
12
12
|
# stubs only a guide never captured, and the gate below refuses to deploy a
|
|
13
13
|
# stub. So the site also runs when publish-docs completes, to publish a fresh
|
|
14
14
|
# capture without waiting for the next push.
|
|
@@ -50,6 +50,7 @@ on:
|
|
|
50
50
|
|
|
51
51
|
permissions:
|
|
52
52
|
contents: read
|
|
53
|
+
actions: read # the newest docs-captures artifact, from the capture run
|
|
53
54
|
|
|
54
55
|
# Never cancel in flight: a cancelled `wrangler pages deploy` is a half-published
|
|
55
56
|
# site, and the next push rebuilds from the same inputs anyway. Queue instead.
|
|
@@ -122,17 +123,28 @@ jobs:
|
|
|
122
123
|
clean: true
|
|
123
124
|
|
|
124
125
|
# The recorded guides' captures, from the product's nightly capture run
|
|
125
|
-
# (publish-docs.yml
|
|
126
|
-
#
|
|
127
|
-
# a site that records no guides,
|
|
128
|
-
#
|
|
129
|
-
# deploy a stub.
|
|
126
|
+
# (publish-docs.yml keeps docs/generated as the docs-captures artifact
|
|
127
|
+
# after a passing engine tier): the newest unexpired one, put where
|
|
128
|
+
# docs:site:public expects it. None yet -- a site that records no guides,
|
|
129
|
+
# or before the first capture -- restores nothing; the build stubs what is
|
|
130
|
+
# missing and the gate below refuses to deploy a stub. gh comes from the
|
|
131
|
+
# build shell (the runners have no system gh).
|
|
130
132
|
- name: Restore the recorded guides' captures
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
env:
|
|
134
|
+
GH_TOKEN: ${{ github.token }}
|
|
135
|
+
run: |
|
|
136
|
+
nix develop .#build --command bash -c '
|
|
137
|
+
set -euo pipefail
|
|
138
|
+
run="$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=docs-captures&per_page=20" \
|
|
139
|
+
--jq "[.artifacts[] | select(.expired | not)][0].workflow_run.id // empty")"
|
|
140
|
+
if [ -z "$run" ]; then
|
|
141
|
+
echo "no docs-captures artifact yet: nothing to restore"
|
|
142
|
+
exit 0
|
|
143
|
+
fi
|
|
144
|
+
mkdir -p docs/generated
|
|
145
|
+
gh run download "$run" --repo "$GITHUB_REPOSITORY" --name docs-captures --dir docs/generated
|
|
146
|
+
echo "restored the recorded guides captured by run $run"
|
|
147
|
+
'
|
|
136
148
|
|
|
137
149
|
# website/ is a STANDALONE package -- its own bun.lock, outside the root
|
|
138
150
|
# workspaces -- so the repo-root install never covers it, and the build
|
|
@@ -319,16 +319,21 @@ jobs:
|
|
|
319
319
|
run: nix develop .#build --command bun run docs:manual
|
|
320
320
|
|
|
321
321
|
# The captures, for the product's own docs site: publish-docs-site.yml
|
|
322
|
-
#
|
|
323
|
-
# the only one that can make them. Only after a
|
|
324
|
-
# site never takes a half-captured set over the
|
|
325
|
-
#
|
|
326
|
-
|
|
322
|
+
# downloads the newest docs-captures artifact, so its recorded guides
|
|
323
|
+
# publish from this run, the only one that can make them. Only after a
|
|
324
|
+
# passing engine tier, so a site never takes a half-captured set over the
|
|
325
|
+
# last good one. An artifact, not actions/cache: a cache entry is
|
|
326
|
+
# versioned by its compression, and the runner pool mixes machines with
|
|
327
|
+
# and without zstd, so a save on one never matched a restore on another
|
|
328
|
+
# (relay, 2026-10-21: saved on ashton-nuc, missed on test2-runner-1).
|
|
329
|
+
- name: Keep the guide captures for the docs site
|
|
327
330
|
if: ${{ steps.engine.outcome == 'success' }}
|
|
328
|
-
uses: actions/
|
|
331
|
+
uses: actions/upload-artifact@v4
|
|
329
332
|
with:
|
|
333
|
+
name: docs-captures
|
|
330
334
|
path: docs/generated
|
|
331
|
-
|
|
335
|
+
retention-days: 30
|
|
336
|
+
if-no-files-found: error
|
|
332
337
|
|
|
333
338
|
# Said three ways, so a failure is never silent: a warning on the run, a
|
|
334
339
|
# line in its summary, and the cell's detail (the notify job).
|