Skip to content

Commit d7b78e4

Browse files
authored
Merge pull request #36 from RosettaCommons/docs/stable_release
Publish docs to stable hosted URLs
2 parents 37fca8b + 9bfc0a7 commit d7b78e4

4 files changed

Lines changed: 73 additions & 6 deletions

File tree

‎.github/workflows/docs.yaml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Publish docs
2+
3+
# Rebuilds and republishes the hosted documentation without cutting a release (no PyPI, GitHub release or
4+
# Marketplace upload). Use it to fix the docs between releases, or to point /latest/ at a given version.
5+
# Normal releases publish docs from release.yaml; this workflow is only ever run by hand.
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
ref:
11+
description: Tag or branch to build the docs from (e.g. v0.0.12, or main for an unreleased docs fix)
12+
required: true
13+
destination:
14+
description: Folder on gh-pages to publish to, either "latest" or a version folder such as "v0.0.12"
15+
required: true
16+
default: latest
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
docs:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
# Shares the group with release.yaml's docs job so the two never push to gh-pages at the same time.
27+
concurrency:
28+
group: studio-versioned-docs
29+
cancel-in-progress: false
30+
steps:
31+
# Only "latest" or a version folder: any other value (empty, "/", "..") could delete the rest of the site.
32+
- name: Check the destination folder
33+
env:
34+
DESTINATION: ${{ inputs.destination }}
35+
run: |
36+
if [[ ! "$DESTINATION" =~ ^(latest|v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?)$ ]]; then
37+
echo "::error::destination must be 'latest' or a version folder like 'v0.0.12', not '$DESTINATION'"
38+
exit 1
39+
fi
40+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41+
with:
42+
ref: ${{ inputs.ref }}
43+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
44+
# The hosted copy carries usage analytics, as in release.yaml (see docs/conf.py).
45+
- run: make docs
46+
env:
47+
STUDIO_DOCS_ANALYTICS: "1"
48+
# Without keep_files, only the destination folder is replaced; every other folder on gh-pages is left alone.
49+
- name: Publish
50+
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
publish_dir: docs/_build/html
54+
destination_dir: ${{ inputs.destination }}

‎.github/workflows/release.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,12 @@ jobs:
127127
publish_dir: docs/_build/html
128128
destination_dir: ${{ github.ref_name }}
129129
keep_files: true
130+
# A stable address for links (the README, the PyPI page) that should not change when the version is bumped.
131+
# Prereleases keep only their versioned copy, so /latest/ always means the newest stable release.
132+
- name: Point /latest/ at this release
133+
if: ${{ !contains(needs.verify.outputs.version, '-') }}
134+
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
135+
with:
136+
github_token: ${{ secrets.GITHUB_TOKEN }}
137+
publish_dir: docs/_build/html
138+
destination_dir: latest

‎README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
</p>
1212

1313
<p align="center">
14-
<a href="https://github.com/RosettaCommons/atomworks-studio/blob/main/docs/index.md">Documentation</a> ·
15-
<a href="https://github.com/RosettaCommons/atomworks-studio/blob/main/docs/INSTALLATION.md">Installation</a> ·
16-
<a href="https://github.com/RosettaCommons/atomworks-studio/blob/main/docs/TUTORIAL.md">Tutorial</a>
14+
<a href="https://rosettacommons.github.io/atomworks-studio/latest/">Documentation</a> ·
15+
<a href="https://rosettacommons.github.io/atomworks-studio/latest/INSTALLATION.html">Installation</a> ·
16+
<a href="https://rosettacommons.github.io/atomworks-studio/latest/TUTORIAL.html">Tutorial</a>
1717
</p>
1818

1919
<p align="center"><img src="https://raw.githubusercontent.com/RosettaCommons/atomworks-studio/main/docs/images/web-molstar-editor.png" alt="AtomWorks Studio in the browser: sequence view, Mol* viewer and annotation panel" width="860"></p>
@@ -71,7 +71,7 @@ The PyMOL plugin offers the same controls natively, here on a nanobody design wi
7171

7272
<p align="center"><img src="https://raw.githubusercontent.com/RosettaCommons/atomworks-studio/main/packages/pymol-plugin/assets/antibody_design.png" alt="AtomWorks Studio panel inside PyMOL on a nanobody design" width="860"></p>
7373

74-
See the [documentation](https://github.com/RosettaCommons/atomworks-studio/blob/main/docs/index.md) for selection syntax, interface guides, Python and HTTP
74+
See the [documentation](https://rosettacommons.github.io/atomworks-studio/latest/) for selection syntax, interface guides, Python and HTTP
7575
integration, and development notes.
7676

7777
## Build from source
@@ -84,7 +84,7 @@ make run
8484
```
8585

8686
The RFD4 annotation definitions and license are bundled in source and release builds and verified against the
87-
SHA-256 hashes in `providers/rfd4/UPSTREAM.toml`. See [provenance](https://github.com/RosettaCommons/atomworks-studio/blob/main/docs/PROVENANCE.md).
87+
SHA-256 hashes in `providers/rfd4/UPSTREAM.toml`. See [provenance](https://rosettacommons.github.io/atomworks-studio/latest/PROVENANCE.html).
8888

8989
## License
9090

‎docs/RELEASE.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ Optional destinations:
3030
The VSIX is always attached to the GitHub release.
3131
- Enable GitHub Pages from `gh-pages` and set the repository variable
3232
`STUDIO_PUBLISH_DOCS=true` to publish docs under `/v<version>/`.
33-
Earlier versions are retained. The documentation archive is always attached
33+
Earlier versions are retained. Stable (non-prerelease) versions are also
34+
copied to `/latest/`, which the README links to, so links never need a
35+
version bump. To fix the hosted docs between releases, run the
36+
"Publish docs" workflow (`docs.yaml`) by hand with the tag or branch to build
37+
and the folder to publish to (`latest` or `v<version>`). The documentation archive is always attached
3438
to the GitHub release, even when Pages is disabled.
3539

3640
## Release downloads

0 commit comments

Comments
 (0)