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
0 commit comments