Skip to content

Commit 88c59aa

Browse files
ci: update docs publishing myst switcher release version
1 parent fb4e453 commit 88c59aa

3 files changed

Lines changed: 41 additions & 52 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
packages: write
4646

4747
docs: # Call the docs building workflow directly
48-
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/docs.yml@v0.24
48+
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/docs.yml@v0.27.0
4949
with:
5050
# Whatever turns your sources into docs/_build/html at $BASE_URL. uv and Node
5151
# are preinstalled, so: make docs · tox -e docs · npm ci && npm run docs
@@ -65,20 +65,6 @@ jobs:
6565
release:
6666
needs: [dist, test, docs]
6767
if: github.ref_type == 'tag' # tag pushes only
68-
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/release.yml@v0.24
68+
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/release.yml@v0.27.0
6969
permissions:
7070
contents: write # create the Release + attach assets
71-
72-
publish:
73-
needs: [docs]
74-
# don't publish a pages site in the fork's org
75-
if: github.repository == 'DiamondLightSource/blueapi' && github.ref_type == 'tag' # publish only on tags
76-
uses: ./.github/workflows/publish-dispatch.yml # your workflow (below)
77-
with:
78-
version-name: ${{ needs.docs.outputs.version-name }}
79-
permissions:
80-
contents: read
81-
actions: write
82-
pages: write
83-
id-token: write
84-
statuses: write

‎.github/workflows/publish-dispatch.yml‎

Lines changed: 0 additions & 36 deletions
This file was deleted.

‎.github/workflows/publish.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish
2+
3+
on:
4+
# matches ci.yml's `name:`, NOT its filename
5+
workflow_run:
6+
workflows: [CI]
7+
types: [completed]
8+
9+
# fork-PR previews and manual re-deploys
10+
workflow_dispatch:
11+
inputs:
12+
pr:
13+
description: "Fork PR to approve + preview (empty = re-deploy)"
14+
required: false
15+
default: ""
16+
17+
jobs:
18+
publish:
19+
# Both guards fail OPEN — copy them verbatim.
20+
# conclusion == 'success' : workflow_run fires on failures too
21+
# head_repository == this repo : workflow_run holds a WRITE token even when a
22+
# fork's PR triggered it (the pwn-request shape)
23+
# The repository check keeps forks of blueapi from publishing to their own Pages.
24+
if: >-
25+
github.repository == 'DiamondLightSource/blueapi' &&
26+
(github.event_name == 'workflow_dispatch' ||
27+
(github.event.workflow_run.conclusion == 'success' &&
28+
github.event.workflow_run.head_repository.full_name == github.repository))
29+
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/publish-gh-pages.yml@v0.27.0
30+
with:
31+
pr: ${{ inputs.pr }}
32+
max-releases: "30"
33+
max-prs: "20"
34+
permissions:
35+
contents: read
36+
actions: read # gather cross-run docs artifacts
37+
pages: write
38+
id-token: write
39+
statuses: write # record the fork-preview approval / preview link

0 commit comments

Comments
 (0)