-
-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (69 loc) · 2.91 KB
/
Copy pathregen-docs.yml
File metadata and controls
76 lines (69 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Regen Docs
# Tells the docs sites to recompile this module's API docs.
#
# Fires on a change to apidoc/ and on a published release, rather than on every
# merged pull request, so a direct push to master is not missed.
on:
workflow_dispatch:
pull_request:
paths: ['apidoc/**']
push:
branches: [master]
paths: ['apidoc/**']
release:
types: [published]
jobs:
regen:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup node
uses: actions/setup-node@v7
with:
node-version: '26'
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint:docs
# titaniumsdk.com. The dispatch lives in titaniumsdk.com so the payload shape is
# defined once for all 17 source repos instead of copied into each.
#
# Deliberately independent of the lint job. Gating the dispatch on it means an
# unrelated tooling problem stops the docs updating and nothing says so --
# ti.coremotion cannot run `npm ci` at all today because its lockfile is out of
# sync with its package.json. Genuinely malformed apidoc still cannot ship: the
# compile in titaniumsdk.com fails on it and commits nothing.
notify:
name: Notify titaniumsdk.com
# Skipped on pull_request: a proposed change gets linted, not published.
# Skipped in forks: they hold no dispatch token, so this would only ever
# produce a failing run. The allowlist in titaniumsdk.com is the actual
# boundary -- a fork's payload names the fork, which is not on it.
if: github.event_name != 'pull_request' && github.repository_owner == 'tidev'
uses: tidev/titaniumsdk.com/.github/workflows/notify-api-docs.yml@main
secrets:
dispatch-token: ${{ secrets.REGEN_DOCS_GITHUB_TOKEN }}
# The old pipeline, kept running alongside the new one so the site currently
# being served stays current while the replacement is proven. It carries no
# payload because titanium-docs does not read one -- it rebuilds every source
# repo on any dispatch, which is the inefficiency titaniumsdk.com replaces.
#
# Delete this job once titaniumsdk.com is served from titaniumsdk.com (TI-52).
notify-legacy:
# Skipped on pull_request: a proposed change gets linted, not published.
# Skipped in forks: they hold no dispatch token, so this would only ever
# produce a failing run. The allowlist in titaniumsdk.com is the actual
# boundary -- a fork's payload names the fork, which is not on it.
if: github.event_name != 'pull_request' && github.repository_owner == 'tidev'
runs-on: ubuntu-latest
name: Notify titanium-docs (legacy)
steps:
- name: Repository dispatch
uses: peter-evans/repository-dispatch@v4
with:
event-type: regen-api-docs
repository: tidev/titanium-docs
token: ${{ secrets.REGEN_DOCS_GITHUB_TOKEN }}