Skip to content

Commit a197552

Browse files
committed
Merge branch 'doc' of github.com:SiyaoIsHiding/java-driver into doc
2 parents e3842d7 + 6c60467 commit a197552

6 files changed

Lines changed: 151 additions & 178 deletions

File tree

.github/workflows/build-docs-gh-pages.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: publish-docs-gh-pages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-docs:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
12+
steps:
13+
# 1. Checkout doc branch
14+
- name: Checkout current branch
15+
uses: actions/checkout@v4
16+
with:
17+
path: java-driver
18+
19+
# 2. Java 8
20+
- name: Set up Java 8
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: temurin
24+
java-version: "8"
25+
cache: maven
26+
27+
# 3. Python 3.10.19 + MkDocs + plugins
28+
- name: Set up Python 3.10.19
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.10.19"
32+
33+
- name: Install MkDocs dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install \
37+
mkdocs \
38+
mkdocs-material \
39+
mkdocs-awesome-pages-plugin \
40+
mkdocs-macros-plugin \
41+
mike
42+
43+
# 4. Build docs via build-doc.sh
44+
- name: Build documentation
45+
working-directory: java-driver
46+
run: |
47+
chmod +x ./build-doc.sh
48+
./build-doc.sh
49+
50+
# 5. Checkout gh-pages branch
51+
- name: Checkout GH pages branch
52+
uses: actions/checkout@v4
53+
with:
54+
ref: gh-pages
55+
path: gh-pages
56+
57+
- name: Copy and version documentation
58+
working-directory: gh-pages
59+
run: |
60+
git config --global user.email "gha@cassandra.apache.org"
61+
git config --global user.name "GHA for Apache Cassandra Website"
62+
63+
cd ../java-driver
64+
# lookup current project version
65+
release_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d- -f1)
66+
# update links to contain version prefix
67+
mike deploy --update-aliases $release_version
68+
# copy documentation web page folder
69+
cd ../gh-pages
70+
cp -r ../java-driver/docs ./
71+
rm -rf $release_version
72+
mv docs $release_version
73+
74+
# update latest symlink
75+
rm latest
76+
ln -s $release_version latest
77+
78+
# remove latest tag
79+
sed -i 's/\"latest\"//g' versions.json
80+
# remove already present line if exists
81+
sed -i '/'"$release_version"'/d' versions.json
82+
# insert new version at the beginning
83+
sed -i '2s/^/ { "version": "'"$release_version"'", "title": "'"$release_version"'", "aliases": ["latest"] },\'$'\n/g' versions.json
84+
85+
echo "release_version=$release_version" >> "$GITHUB_ENV"
86+
87+
- name: Commit and push documentation
88+
working-directory: gh-pages
89+
run: |
90+
git config --global user.email "gha@cassandra.apache.org"
91+
git config --global user.name "GHA for Apache Cassandra Website"
92+
93+
git add .
94+
95+
if git diff --cached --quiet; then
96+
echo "No changes to push to gh-pages"
97+
exit 0
98+
fi
99+
100+
git commit -m "Update generated docs for release ${release_version}"
101+
git push origin gh-pages

.github/workflows/update-docs-staging.yml

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

faq/favicon.ico

16.5 KB
Binary file not shown.

faq/logo.png

28.1 KB
Loading

mkdocs.yml

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ site_dir: docs
99

1010
theme:
1111
name: material
12-
palette:
13-
- scheme: default
14-
primary: blue
15-
accent: blue
12+
logo: faq/logo.png
13+
favicon: faq/favicon.ico
1614
features:
1715
- navigation.tabs
18-
- navigation.sections
1916
- navigation.top
17+
- navigation.path
2018
- search.highlight
2119
- search.share
2220

@@ -26,6 +24,7 @@ markdown_extensions:
2624
- pymdownx.superfences
2725
- pymdownx.tabbed
2826
- toc:
27+
toc_depth: 2-3
2928
permalink: true
3029

3130
nav:
@@ -39,49 +38,56 @@ nav:
3938
- Overview: manual/core/README.md
4039
- Integration: manual/core/integration/README.md
4140
- Configuration:
42-
- Overview: manual/core/configuration/README.md
43-
- Reference: manual/core/configuration/reference/README.md
44-
- Authentication: manual/core/authentication/README.md
45-
- SSL: manual/core/ssl/README.md
46-
- Load Balancing: manual/core/load_balancing/README.md
47-
- Pooling: manual/core/pooling/README.md
48-
- Reconnection: manual/core/reconnection/README.md
49-
- Retries: manual/core/retries/README.md
50-
- Speculative Execution: manual/core/speculative_execution/README.md
51-
- Metrics: manual/core/metrics/README.md
52-
- Logging: manual/core/logging/README.md
41+
- Overview: manual/core/configuration/README.md
42+
- Reference: manual/core/configuration/reference/README.md
43+
- Connection Management:
44+
- Authentication: manual/core/authentication/README.md
45+
- SSL: manual/core/ssl/README.md
46+
- Pooling: manual/core/pooling/README.md
47+
- Load Balancing: manual/core/load_balancing/README.md
48+
- Reconnection: manual/core/reconnection/README.md
49+
- Address Resolution: manual/core/address_resolution/README.md
5350
- Statements:
5451
- Overview: manual/core/statements/README.md
5552
- Batch: manual/core/statements/batch/README.md
5653
- Per Query Keyspace: manual/core/statements/per_query_keyspace/README.md
5754
- Prepared: manual/core/statements/prepared/README.md
5855
- Simple: manual/core/statements/simple/README.md
59-
- Paging: manual/core/paging/README.md
60-
- Async Programming: manual/core/async/README.md
61-
- Reactive Streams: manual/core/reactive/README.md
62-
- Custom Codecs: manual/core/custom_codecs/README.md
63-
- Temporal Types: manual/core/temporal_types/README.md
64-
- Tuples: manual/core/tuples/README.md
65-
- UDTs: manual/core/udts/README.md
66-
- Compression: manual/core/compression/README.md
67-
- Address Resolution: manual/core/address_resolution/README.md
68-
- Request Tracker: manual/core/request_tracker/README.md
69-
- Request ID: manual/core/request_id/README.md
70-
- Throttling: manual/core/throttling/README.md
71-
- Tracing: manual/core/tracing/README.md
72-
- Performance: manual/core/performance/README.md
56+
- Query Execution:
57+
- Retries: manual/core/retries/README.md
58+
- Idempotence: manual/core/idempotence/README.md
59+
- Speculative Execution: manual/core/speculative_execution/README.md
60+
- Paging: manual/core/paging/README.md
61+
- Query Timestamps: manual/core/query_timestamps/README.md
62+
- Advanced Types:
63+
- Custom Codecs: manual/core/custom_codecs/README.md
64+
- Temporal Types: manual/core/temporal_types/README.md
65+
- Tuples: manual/core/tuples/README.md
66+
- UDTs: manual/core/udts/README.md
67+
- Detachable Types: manual/core/detachable_types/README.md
68+
- Non-blocking:
69+
- Overview: manual/core/non_blocking/README.md
70+
- Async Programming: manual/core/async/README.md
71+
- Reactive Streams: manual/core/reactive/README.md
72+
- Observability:
73+
- Request Tracker: manual/core/request_tracker/README.md
74+
- Request ID: manual/core/request_id/README.md
75+
- Metrics: manual/core/metrics/README.md
76+
- Logging: manual/core/logging/README.md
77+
- Tracing: manual/core/tracing/README.md
78+
- Performance:
79+
- Overview: manual/core/performance/README.md
80+
- Throttling: manual/core/throttling/README.md
81+
- Compression: manual/core/compression/README.md
7382
- Metadata:
7483
- Overview: manual/core/metadata/README.md
7584
- Node: manual/core/metadata/node/README.md
7685
- Schema: manual/core/metadata/schema/README.md
7786
- Token: manual/core/metadata/token/README.md
78-
- Control Connection: manual/core/control_connection/README.md
79-
- Native Protocol: manual/core/native_protocol/README.md
80-
- Non-blocking: manual/core/non_blocking/README.md
81-
- Query Timestamps: manual/core/query_timestamps/README.md
82-
- Idempotence: manual/core/idempotence/README.md
83-
- Detachable Types: manual/core/detachable_types/README.md
84-
- DSE:
87+
- Driver Internals:
88+
- Control Connection: manual/core/control_connection/README.md
89+
- Native Protocol: manual/core/native_protocol/README.md
90+
- DataStax DSE:
8591
- Overview: manual/core/dse/README.md
8692
- Geotypes: manual/core/dse/geotypes/README.md
8793
- Graph:
@@ -162,3 +168,10 @@ plugins:
162168
- search
163169
- awesome-pages
164170
- macros
171+
- mike:
172+
alias_type: copy
173+
174+
extra:
175+
generator: false
176+
version:
177+
provider: mike

0 commit comments

Comments
 (0)