Skip to content

Commit acb5880

Browse files
committed
docs: Antora Redis OM Documentation site
1 parent 7dcf381 commit acb5880

File tree

84 files changed

+19944
-7
lines changed

Some content is hidden

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

84 files changed

+19944
-7
lines changed

.github/workflows/docs.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Deploy Docs
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [published]
6+
repository_dispatch:
7+
types: [build-docs]
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
name: Build and Deploy Docs
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0 # Fetch all history for all branches and tags
31+
fetch-tags: true # Explicitly fetch tags
32+
33+
- name: Fetch all tags
34+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
35+
36+
- name: Set up Java
37+
uses: actions/setup-java@v4
38+
with:
39+
java-version: 21
40+
distribution: 'zulu'
41+
42+
- name: Set up Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: 20
46+
47+
- name: Cache Gradle
48+
uses: actions/cache@v4
49+
with:
50+
path: ~/.gradle/caches
51+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
52+
restore-keys: |
53+
${{ runner.os }}-gradle-
54+
55+
- name: Cache Gradle wrapper
56+
uses: actions/cache@v4
57+
with:
58+
path: ~/.gradle/wrapper
59+
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
60+
restore-keys: ${{ runner.os }}-gradlew-
61+
62+
- name: Set Release Version in Docs
63+
run: |
64+
VERSION=$(cat gradle.properties | grep "version" | cut -d'=' -f2 | tr -d ' ')
65+
echo "Setting documentation version to $VERSION"
66+
67+
# For current version
68+
sed -i "s/display_version: '.*'/display_version: '$VERSION'/" docs/content/antora.yml
69+
sed -i "s/redis-om-version: '.*'/redis-om-version: '$VERSION'/" docs/content/antora.yml
70+
71+
# Check for existing tag in playbook
72+
if ! grep -q "v$VERSION" docs/antora-playbook.yml; then
73+
if [[ ! "$VERSION" == *-SNAPSHOT ]]; then
74+
echo "Version $VERSION not found in playbook. Adding if tag exists."
75+
# Only add the tag if it exists in the repository
76+
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
77+
echo "Adding version v$VERSION to Antora playbook"
78+
sed -i "/tags:/a \ - v${VERSION}" docs/antora-playbook.yml
79+
fi
80+
fi
81+
fi
82+
83+
- name: Show Git Info
84+
run: |
85+
echo "Available tags:"
86+
git tag -l
87+
88+
echo "Current branch:"
89+
git branch --show-current
90+
91+
echo "Antora playbook content:"
92+
cat docs/antora-playbook.yml
93+
94+
- name: Build Documentation
95+
run: |
96+
cd docs
97+
./gradlew generateSite
98+
if [ ! -d "build/site" ] || [ -z "$(ls -A build/site)" ]; then
99+
echo "Site build failed or directory is empty. Falling back to direct Antora command."
100+
npm install
101+
./node_modules/.bin/antora --fetch --stacktrace --log-format=pretty antora-playbook.yml --to-dir=build/site
102+
fi
103+
104+
- name: Verify Build Output
105+
run: |
106+
if [ ! -d "docs/build/site" ] || [ -z "$(ls -A docs/build/site)" ]; then
107+
echo "ERROR: Documentation build failed. Site directory is empty."
108+
exit 1
109+
fi
110+
echo "Documentation built successfully."
111+
ls -la docs/build/site
112+
113+
- name: Add .nojekyll file
114+
run: touch docs/build/site/.nojekyll
115+
116+
- name: Setup Pages
117+
uses: actions/configure-pages@v4
118+
119+
- name: Upload artifact
120+
uses: actions/upload-pages-artifact@v3
121+
with:
122+
path: 'docs/build/site'
123+
124+
- name: Deploy to GitHub Pages
125+
id: deployment
126+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,9 @@ jobs:
103103
path: |
104104
out/jreleaser/trace.log
105105
out/jreleaser/output.properties
106+
107+
- name: Trigger documentation build
108+
uses: peter-evans/repository-dispatch@v2
109+
with:
110+
token: ${{ secrets.GIT_ACCESS_TOKEN }}
111+
event-type: build-docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ docs/build/
4040
build/
4141
.gradle/
4242
compile_debug.log
43+
docs/.cache/*

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,9 @@ dependencies {
548548

549549
## 📚 Documentation
550550

551-
The Redis OM documentation is available [here](docs/index.md).
551+
The Redis OM Spring documentation is available at:
552+
- [Local Documentation](docs/index.md)
553+
- [Online Documentation](https://redis.github.io/redis-om-spring/) (Generated from the main branch)
552554

553555
## Demos
554556

docs/.github/workflows/docs.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Deploy Docs
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [published]
6+
repository_dispatch:
7+
types: [build-docs]
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
name: Build and Deploy Docs
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Set up Java
33+
uses: actions/setup-java@v4
34+
with:
35+
java-version: 21
36+
distribution: 'zulu'
37+
38+
- name: Set up Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
42+
43+
- name: Cache Gradle
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/.gradle/caches
47+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
48+
restore-keys: |
49+
${{ runner.os }}-gradle-
50+
51+
- name: Cache Gradle wrapper
52+
uses: actions/cache@v4
53+
with:
54+
path: ~/.gradle/wrapper
55+
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
56+
restore-keys: ${{ runner.os }}-gradlew-
57+
58+
- name: Set Release Version in Docs
59+
run: |
60+
VERSION=$(cat gradle.properties | grep "version" | cut -d'=' -f2 | tr -d ' ')
61+
echo "Setting documentation version to $VERSION"
62+
sed -i "s/display_version: '.*'/display_version: '$VERSION'/" docs/content/antora.yml
63+
sed -i "s/redis-om-version: '.*'/redis-om-version: '$VERSION'/" docs/content/antora.yml
64+
65+
- name: Build Documentation
66+
run: |
67+
./gradlew :docs:build
68+
69+
- name: Add .nojekyll file
70+
run: touch docs/build/site/.nojekyll
71+
72+
- name: Setup Pages
73+
uses: actions/configure-pages@v4
74+
75+
- name: Upload artifact
76+
uses: actions/upload-pages-artifact@v3
77+
with:
78+
path: 'docs/build/site'
79+
80+
- name: Deploy to GitHub Pages
81+
id: deployment
82+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)