Skip to content

Commit 396d219

Browse files
authored
Merge pull request #151 from vdice/ci/docs
ci(*): automate docs publishing
2 parents 95373e6 + 6cb7ead commit 396d219

244 files changed

Lines changed: 77 additions & 109119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
docs/** linguist-generated=true
21
src/spin_sdk/wit/** linguist-generated=true
32
src/componentize_py_* linguist-generated=true
43
src/componentize_py_*/** linguist-generated=true

.github/workflows/docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['v*']
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Parse version
18+
id: version
19+
run: |
20+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
21+
# Parse the major version
22+
TAG="${{ github.ref_name }}"
23+
echo "folder=${TAG%%.*}" >> $GITHUB_OUTPUT
24+
else
25+
# Default for pushes to main
26+
echo "folder=canary" >> $GITHUB_OUTPUT
27+
fi
28+
29+
- name: Generate Documentation
30+
run: |
31+
pip install pdoc3
32+
./scripts/generate_docs.py ${{ steps.version.outputs.folder }}
33+
34+
- name: Deploy to versioned folder
35+
uses: JamesIves/github-pages-deploy-action@v4
36+
with:
37+
branch: gh-pages
38+
folder: docs
39+
target-folder: docs
40+
clean: false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ __pycache__
77
src/spin_sdk.egg-info
88
dist
99
venv/
10+
docs

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ bash regenerate_bindings.sh
2424

2525
### Updating docs
2626

27-
Any time you regenerate the bindings or edit files by hand, you'll want to
28-
regenerate the HTML docs to match. First, install `pdoc` using `pip install
29-
pdoc3`. Then, update the docs using:
30-
31-
```bash
32-
./scripts/generate_docs.py
33-
```
27+
Docs are [updated automatically](.github/workflows/docs.yml) on merges to main and tag pushes.
3428

3529
### Building the distribution
3630

docs/http/index.html

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

docs/http/poll_loop.html

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

docs/index.html

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

0 commit comments

Comments
 (0)