Skip to content

Commit fb2c195

Browse files
committed
docs: refactor to use sphinx-ape
1 parent 3785f1d commit fb2c195

11 files changed

Lines changed: 36 additions & 785 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,38 @@
11
name: Docs
22

33
on:
4-
push:
5-
branches: [main]
6-
release:
7-
types: [released]
8-
pull_request:
9-
types: [opened, synchronize]
4+
push:
5+
branches: [main]
6+
release:
7+
types: [released]
8+
pull_request:
9+
types: [opened, synchronize]
10+
11+
concurrency:
12+
# Cancel older, in-progress jobs from the same PR, same workflow.
13+
# use run_id if the job is triggered by a push to ensure
14+
# push-triggered jobs to not get canceled.
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
1017

1118
jobs:
12-
docs:
13-
runs-on: ubuntu-latest
14-
15-
permissions:
16-
contents: write
17-
18-
steps:
19-
- uses: actions/checkout@v4
20-
21-
- name: Setup Python
22-
uses: actions/setup-python@v5
23-
with:
24-
python-version: "3.10"
25-
26-
- name: Install Dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install .[doc]
30-
31-
- name: Build HTML artifact
32-
run: python build_docs.py
33-
34-
- name: Upload HTML artifact
35-
uses: actions/upload-artifact@v4
36-
with:
37-
name: DocumentationHTML
38-
path: docs/_build/ethpm-types
39-
40-
- name: Commit and publish documentation changes to gh-pages branch
41-
run: |
42-
if [[ "${GITHUB_EVENT_NAME}" =~ "pull_request" ]]; then
43-
echo "skipping 'git commit' step for PR"
44-
else
45-
git clone https://github.com/${GITHUB_REPOSITORY} --branch gh-pages --single-branch gh-pages
46-
cp -r docs/_build/ethpm-types/* gh-pages/
47-
cd gh-pages
48-
touch .nojekyll
49-
git config --local user.email "action@github.com"
50-
git config --local user.name "GitHub Action"
51-
git add .
52-
git commit -m "Update documentation" -a || true
53-
fi
54-
- name: Push changes
55-
uses: ad-m/github-push-action@master
56-
if: ${{ github.event_name != 'pull_request' }}
57-
with:
58-
branch: gh-pages
59-
directory: gh-pages
60-
github_token: ${{ secrets.GITHUB_TOKEN }}
19+
docs:
20+
runs-on: ubuntu-latest
21+
22+
permissions:
23+
contents: write
24+
25+
steps:
26+
- uses: actions/checkout@v5
27+
- uses: astral-sh/setup-uv@v7
28+
29+
- name: Install Dependencies
30+
run: |
31+
uv venv
32+
source .venv/bin/activate
33+
uv pip install . --group doc
34+
35+
- name: Ape Docs
36+
uses: apeworx/sphinx-ape@main
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}

build_docs.py

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

docs/_static/custom.css

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

0 commit comments

Comments
 (0)