Skip to content

Commit fdbe39f

Browse files
Docs: adds docusaurus site (#1342)
1 parent 9db47c3 commit fdbe39f

File tree

91 files changed

+16497
-1556
lines changed

Some content is hidden

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

91 files changed

+16497
-1556
lines changed

.github/maintainers_guide.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ By installing App(2) and App(3), you get the followings. Set them as env variabl
7878

7979
### Generating Documentation
8080

81-
The documentation is built using [Jekyll](https://jekyllrb.com/) and hosted with GitHub Pages. The source files are
82-
contained in the `docs` directory. Reading the Jekyll configuration in `docs/_config.yml` is helpful to understand how
83-
the documentation is organized and built.
84-
85-
Refer to the [README](https://github.com/slackapi/java-slack-sdk/blob/master/docs/README.md) for details.
81+
Refer to the [README](https://github.com/slackapi/java-slack-sdk/blob/main/docs/README.md) for details on editing documentation.
8682

8783
### Releasing
8884

.github/workflows/docs-deploy.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Implement docs site
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- 'docs/**'
14+
workflow_dispatch:
15+
16+
jobs:
17+
build:
18+
name: Build Docusaurus
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: npm
28+
cache-dependency-path: docs/package-lock.json
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
working-directory: ./docs
33+
34+
- name: Read version from docs/version-config.yml
35+
id: read_version
36+
run: |
37+
sdkLatestVersionValue=$(grep 'sdkLatestVersion:' docs/version-config.yml | awk '{print $2}')
38+
okhttpVersionValue=$(grep 'okhttpVersion:' docs/version-config.yml | awk '{print $2}')
39+
slf4jApiVersionValue=$(grep 'slf4jApiVersion:' docs/version-config.yml | awk '{print $2}')
40+
kotlinVersionValue=$(grep 'kotlinVersion:' docs/version-config.yml | awk '{print $2}')
41+
helidonVersionValue=$(grep 'helidonVersion:' docs/version-config.yml | awk '{print $2}')
42+
javaxWebsocketApiVersionValue=$(grep 'javaxWebsocketApiVersion:' docs/version-config.yml | awk '{print $2}')
43+
springBootVersionValue=$(grep 'springBootVersion:' docs/version-config.yml | awk '{print $2}')
44+
compatibleMicronautVersionValue=$(grep 'compatibleMicronautVersion:' docs/version-config.yml | awk '{print $2}')
45+
quarkusVersionValue=$(grep 'quarkusVersion:' docs/version-config.yml | awk '{print $2}')
46+
tyrusStandaloneClientVersionValue=$(grep 'tyrusStandaloneClientVersion:' docs/version-config.yml | awk '{print $2}')
47+
echo "sdkLatestVersion=$sdkLatestVersionValue" >> $GITHUB_ENV
48+
echo "okhttpVersion=$okhttpVersionValue" >> $GITHUB_ENV
49+
echo "slf4jApiVersion=$slf4jApiVersionValue" >> $GITHUB_ENV
50+
echo "kotlinVersion=$kotlinVersionValue" >> $GITHUB_ENV
51+
echo "helidonVersion=$helidonVersionValue" >> $GITHUB_ENV
52+
echo "javaxWebsocketApiVersion=$javaxWebsocketApiVersionValue" >> $GITHUB_ENV
53+
echo "springBootVersion=$springBootVersionValue" >> $GITHUB_ENV
54+
echo "compatibleMicronautVersion=$compatibleMicronautVersionValue" >> $GITHUB_ENV
55+
echo "quarkusVersion=$quarkusVersionValue" >> $GITHUB_ENV
56+
echo "tyrusStandaloneClientVersion=$tyrusStandaloneClientVersionValue" >> $GITHUB_ENV
57+
58+
- name: Replace placeholders in .md files
59+
run: |
60+
DOCS_DIR="./docs/content"
61+
find $DOCS_DIR -name "*.md" | while read file; do
62+
sed -i "s/sdkLatestVersion/${{ env.sdkLatestVersion }}/g" "$file"
63+
sed -i "s/okhttpVersion/${{ env.okhttpVersion }}/g" "$file"
64+
sed -i "s/slf4jApiVersion/${{ env.slf4jApiVersion }}/g" "$file"
65+
sed -i "s/kotlinVersion/${{ env.kotlinVersion }}/g" "$file"
66+
sed -i "s/helidonVersion/${{ env.helidonVersion }}/g" "$file"
67+
sed -i "s/javaxWebsocketApiVersion/${{ env.javaxWebsocketApiVersion }}/g" "$file"
68+
sed -i "s/springBootVersion/${{ env.springBootVersion }}/g" "$file"
69+
sed -i "s/compatibleMicronautVersion/${{ env.compatibleMicronautVersion }}/g" "$file"
70+
sed -i "s/quarkusVersion/${{ env.quarkusVersion }}/g" "$file"
71+
sed -i "s/tyrusStandaloneClientVersion/${{ env.tyrusStandaloneClientVersion }}/g" "$file"
72+
done
73+
- name: Build website
74+
run: npm run build
75+
working-directory: ./docs
76+
77+
- name: Upload Build Artifact
78+
uses: actions/upload-pages-artifact@v3
79+
with:
80+
path: ./docs/build
81+
82+
deploy:
83+
name: Deploy to GitHub Pages
84+
if: github.event_name != 'pull_request'
85+
needs: build
86+
87+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
88+
permissions:
89+
pages: write # to deploy to Pages
90+
id-token: write # verifies deployment is from an appropriate source
91+
92+
# Deploy to the github-pages environment
93+
environment:
94+
name: github-pages
95+
url: ${{ steps.deployment.outputs.page_url }}
96+
97+
runs-on: ubuntu-latest
98+
steps:
99+
- name: Deploy to GitHub Pages
100+
id: deployment
101+
uses: actions/deploy-pages@v4

docs/.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
_site
2-
.env
3-
.jekyll-metadata
4-
vendor/
1+
node_modules/
2+
.docusaurus
3+
build

docs/.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/Gemfile

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

0 commit comments

Comments
 (0)