Skip to content

Commit 0068cd4

Browse files
authored
Add documentation with Sphinx (#6)
* docs: add basic sphinx docs * docs: update docs
1 parent f29d1ae commit 0068cd4

120 files changed

Lines changed: 16183 additions & 6 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.

.github/workflows/docs.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Documentation
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- "docs/**"
8+
- "src/**"
9+
- "pyproject.toml"
10+
- ".github/workflows/docs.yml"
11+
12+
# Sets permissions of the GITHUB_TOKEN
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
jobs:
18+
build-docs:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v6
25+
with:
26+
enable-cache: true
27+
28+
- name: Install dependencies
29+
run: |
30+
uv sync --dev --groups docs
31+
32+
- name: Configure Git
33+
run: |
34+
git config user.name 'github-actions[bot]'
35+
git config user.email 'github-actions[bot]@users.noreply.github.com'
36+
37+
- name: Build documentation
38+
run: |
39+
cd docs
40+
make clean
41+
make html
42+
43+
- name: Prepare docs branch
44+
run: |
45+
# Create/switch to docs branch
46+
git checkout -B docs
47+
48+
# Remove existing docs if any
49+
rm -rf docs/build || true
50+
51+
# Move built docs to root docs/build directory
52+
mkdir -p docs/build
53+
cp -r docs/_build/html/* docs/build/
54+
55+
# Stage changes
56+
git add docs/build
57+
58+
# Only proceed if there are changes to commit
59+
if git diff --staged --quiet; then
60+
echo "No changes to documentation"
61+
exit 0
62+
fi
63+
64+
# Commit changes
65+
git commit -m "Update documentation from main branch"
66+
67+
# Push to docs branch
68+
git push origin docs --force
69+
70+
- name: Create Pull Request
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
# Check if PR already exists
75+
PR_EXISTS=$(gh pr list --head docs --base main --json number -q length)
76+
77+
if [ "$PR_EXISTS" -eq "0" ]; then
78+
# Create PR if it doesn't exist
79+
gh pr create \
80+
--base main \
81+
--head docs \
82+
--title "Documentation Update" \
83+
--body "Automated documentation update from main branch.
84+
85+
This PR was automatically generated by the documentation workflow when changes were detected in the docs, source code, or project configuration." \
86+
--label "documentation"
87+
else
88+
echo "PR from docs branch already exists. Skipping PR creation."
89+
fi

docs/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Minimal makefile for Sphinx documentation
2+
3+
# You can set these variables from the command line, and also
4+
# from the environment for the first two.
5+
SPHINXOPTS ?=
6+
SPHINXBUILD ?= sphinx-build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile clean
15+
16+
# Clean the build directory
17+
clean:
18+
rm -rf $(BUILDDIR)/*
19+
20+
# Catch-all target: route all unknown targets to Sphinx using the new
21+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
22+
%: Makefile
23+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Sphinx documentation configuration package for Athena Client."""
32.1 KB
Binary file not shown.
28.9 KB
Binary file not shown.
31.7 KB
Binary file not shown.
21.7 KB
Binary file not shown.
22.6 KB
Binary file not shown.
16.2 KB
Binary file not shown.
64.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)