Skip to content

Commit 72eaaea

Browse files
authored
docs: Add documentation on deployment and versioning of docs site (#1800)
* docs: Add documentation on deployment and versioning of docs site * docs: Clarify GH label
1 parent 8b0a9b8 commit 72eaaea

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

docs/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,36 @@ The documentation website is currently hosted on https://chanzuckerberg.github.i
55
The documentation site is rebuilt each time a tag is created on the repo, which happens on release. This will include the Sphinx website (for the Python API)
66

77
A full rebuild can also be triggered manually as the workflow supports `workflow_dispatch`. This should be done if a bug in the documentation is found and a release is not necessary.
8+
9+
## Versioned documentation
10+
11+
To make sure the documentation on the site refers to the correct version of the Portal API, the site is versioned. This
12+
means that the documentation pages contain a version switcher listing the available versions. To add a new version to the
13+
switcher, edit the `version_info` section of the `html_theme_options` config dictionary in `docs/conf.py`. For example,
14+
15+
```python
16+
"version_info": [
17+
{
18+
"version": "dev", # version number or path
19+
"title": "Stable (latest)", # title to be displayed in the dropdown
20+
"aliases": ["stable"], # list of aliases for the version; not needed for regular versions, only latest/stable
21+
},
22+
# Add new versions here
23+
{
24+
"version": "v4.0",
25+
"title": "v4.0",
26+
"aliases": [""],
27+
},
28+
],
29+
```
30+
31+
## Branches
32+
33+
Multiple branches are used to manage the documentation:
34+
- `main`: This branch contains the latest version of the documentation. It is automatically deployed to the `dev` folder of the `gh-pages` branch when a new PR is merged. **This is the default version of the documentation**.
35+
- `docs-vX.X`: These branches contain the documentation for the specific version of the API. They are automatically deployed to the `vX.X` folder of the `gh-pages` branch when a new release is made, or manually if the `backport-docs` label is used in a new PR.
36+
- `gh-pages`: This branch contains the generated documentation. It is automatically updated when a new PR is merged to the `main` branch, and needs to be manually updated when the `backport-docs` label is used in a new PR. A symbolic link called `stable` points to the latest version of the documentation, making sure this is the default version of the site.
37+
38+
## Backports
39+
40+
The latest version of the site is automatically generated and deployed to the `gh-pages` branch whenever a PR is merged to the main branch. However, if a bug is found in the documentation for a previous version, the `backport-docs` GitHub label can be used on a pull request or issue to flag the need for a rebuild of the documentation for that version. In that case, the commits associated with the PR will be (manually) cherry-picked to the `docs-vX.X` branch, and the documentation will need to be rebuilt and deployed to the `gh-pages` branch.

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@
119119
"version_info": [
120120
{
121121
"version": "dev", # version number or path
122-
"title": "Latest",
123-
"aliases": [],
122+
"title": "Stable (latest)", # title to be displayed in the dropdown
123+
"aliases": ["stable"], # list of aliases for the version
124124
},
125125
{
126126
"version": "v4.0",
127-
"title": "Stable (v4.0)",
128-
"aliases": ["stable"],
127+
"title": "v4.0",
128+
"aliases": [""],
129129
},
130130
],
131131
}

0 commit comments

Comments
 (0)