Skip to content

Commit 885deeb

Browse files
committed
add documentation framework
1 parent 012f098 commit 885deeb

28 files changed

+1188
-364
lines changed

.copier-answers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ _commit: 5.0.1
33
_src_path: https://github.com/diamondlightsource/python-copier-template
44
author_email: giles.knap@diamond.ac.uk
55
author_name: Giles Knap
6-
description: a container that mounts remote devices locally using anywhereusb
6+
description: A client-server application for remotely sharing USB devices with usbip
77
distribution_name: usb-remote
88
docker: true
99
docker_debug: false
10-
docs_type: README
10+
docs_type: sphinx
1111
git_platform: github.com
1212
github_org: epics-containers
1313
package_name: usb_remote

.github/workflows/_docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
workflow_call:
3+
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Avoid git conflicts when tag and branch pushed at same time
11+
if: github.ref_type == 'tag'
12+
run: sleep 60
13+
14+
- name: Checkout
15+
uses: actions/checkout@v5
16+
with:
17+
# Need this to get version number from last tag
18+
fetch-depth: 0
19+
20+
- name: Install system packages
21+
run: sudo apt-get install graphviz
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v7
25+
26+
- name: Build docs
27+
run: uv run --locked tox -e docs
28+
29+
- name: Remove environment.pickle
30+
run: rm build/html/.doctrees/environment.pickle
31+
32+
- name: Upload built docs artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: docs
36+
path: build
37+
38+
- name: Sanitize ref name for docs version
39+
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV
40+
41+
- name: Move to versioned directory
42+
run: mv build/html .github/pages/$DOCS_VERSION
43+
44+
- name: Write switcher.json
45+
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
46+
47+
- name: Publish Docs to gh-pages
48+
if: github.ref_type == 'tag' || github.ref_name == 'main'
49+
# We pin to the SHA, not the tag, for security reasons.
50+
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
51+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
publish_dir: .github/pages
55+
keep_files: true

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
contents: read
3737
packages: write
3838

39+
docs:
40+
uses: ./.github/workflows/_docs.yml
41+
permissions:
42+
contents: write
43+
3944
dist:
4045
uses: ./.github/workflows/_dist.yml
4146

@@ -47,7 +52,7 @@ jobs:
4752
id-token: write
4853

4954
release:
50-
needs: [dist, test]
55+
needs: [dist, test, docs]
5156
if: github.ref_type == 'tag'
5257
uses: ./.github/workflows/_release.yml
5358
permissions:

.github/workflows/periodic.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Periodic
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Run weekly to check URL links still resolve
7+
- cron: "0 8 * * WED"
8+
9+
jobs:
10+
linkcheck:
11+
uses: ./.github/workflows/_tox.yml
12+
with:
13+
tox: docs -- -b linkcheck

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@ Source | <https://github.com/epics-containers/usb-remote>
1111
:---: | :---:
1212
PyPI | `pip install usb-remote`
1313
Docker | `docker run ghcr.io/epics-containers/usb-remote:latest`
14+
Documentation | <https://epics-containers.github.io/usb-remote>
1415
Releases | <https://github.com/epics-containers/usb-remote/releases>
1516

16-
## Documentation
17-
18-
- **[Quick Start Guide](docs/QUICKSTART.md)** - Get started from installation to first device share
19-
- **[Architecture](docs/ARCHITECTURE.md)** - Understand the client-server model and design
20-
- **[Raspberry Pi Setup](docs/RASBERRYPI.md)** - Guide to setting up a Raspberry Pi as a USB server
21-
2217
## Multi-Server Configuration
2318

2419
You can configure `usb-remote` to scan multiple USB device servers automatically. The client discovers configuration files in the following priority order:
@@ -150,3 +145,7 @@ usb-remote uninstall-service
150145
# Uninstall system service (requires sudo)
151146
sudo usb-remote uninstall-service --system
152147
```
148+
149+
<!-- README only content. Anything below this line won't be included in index.md -->
150+
151+
See https://epics-containers.github.io/usb-remote for more detailed documentation.

0 commit comments

Comments
 (0)