Skip to content

Docs: adds docusaurus site #1

Docs: adds docusaurus site

Docs: adds docusaurus site #1

Workflow file for this run

name: Deploy to GitHub Pages
on:
pull_request:
branches:
- main
paths:
- 'docs/**'
push:
branches:
- main
paths:
- 'docs/**'
workflow_dispatch:
jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: ./docs
- name: Read version from docs/config.yml
id: read_version
run: |
sdkLatestVersionValue=$(grep 'sdkLatestVersion:' docs/config.yml | awk '{print $2}')
okhttpVersionValue=$(grep 'okhttpVersion:' docs/config.yml | awk '{print $2}')
slf4jApiVersionValue=$(grep 'slf4jApiVersion:' docs/config.yml | awk '{print $2}')
kotlinVersionValue=$(grep 'kotlinVersion:' docs/config.yml | awk '{print $2}')
helidonVersionValue=$(grep 'helidonVersion:' docs/config.yml | awk '{print $2}')
javaxWebsocketApiVersionValue=$(grep 'javaxWebsocketApiVersion:' docs/config.yml | awk '{print $2}')
springBootVersionValue=$(grep 'springBootVersion:' docs/config.yml | awk '{print $2}')
compatibleMicronautVersionValue=$(grep 'compatibleMicronautVersion:' docs/config.yml | awk '{print $2}')
quarkusVersionValue=$(grep 'quarkusVersion:' docs/config.yml | awk '{print $2}')
tyrusStandaloneClientVersionValue=$(grep 'tyrusStandaloneClientVersion:' docs/config.yml | awk '{print $2}')
echo "sdkLatestVersion=$sdkLatestVersionValue" >> $GITHUB_ENV
echo "okhttpVersion=$okhttpVersionValue" >> $GITHUB_ENV
echo "slf4jApiVersion=$slf4jApiVersionValue" >> $GITHUB_ENV
echo "kotlinVersion=$kotlinVersionValue" >> $GITHUB_ENV
echo "helidonVersion=$helidonVersionValue" >> $GITHUB_ENV
echo "javaxWebsocketApiVersion=$javaxWebsocketApiVersionValue" >> $GITHUB_ENV
echo "springBootVersion=$springBootVersionValue" >> $GITHUB_ENV
echo "compatibleMicronautVersion=$compatibleMicronautVersionValue" >> $GITHUB_ENV
echo "quarkusVersion=$quarkusVersionValue" >> $GITHUB_ENV
echo "tyrusStandaloneClientVersion=$tyrusStandaloneClientVersionValue" >> $GITHUB_ENV
- name: Replace placeholders in .md files
run: |
DOCS_DIR="./docs/content"
find $DOCS_DIR -name "*.md" | while read file; do
sed -i "s/sdkLatestVersion/${{ env.sdkLatestVersion }}/g" "$file"
sed -i "s/okhttpVersion/${{ env.okhttpVersion }}/g" "$file"
sed -i "s/slf4jApiVersion/${{ env.slf4jApiVersion }}/g" "$file"
sed -i "s/kotlinVersion/${{ env.kotlinVersion }}/g" "$file"
sed -i "s/helidonVersion/${{ env.helidonVersion }}/g" "$file"
sed -i "s/javaxWebsocketApiVersion/${{ env.javaxWebsocketApiVersion }}/g" "$file"
sed -i "s/springBootVersion/${{ env.springBootVersion }}/g" "$file"
sed -i "s/compatibleMicronautVersion/${{ env.compatibleMicronautVersion }}/g" "$file"
sed -i "s/quarkusVersion/${{ env.quarkusVersion }}/g" "$file"
sed -i "s/tyrusStandaloneClientVersion/${{ env.tyrusStandaloneClientVersion }}/g" "$file"
done
- name: Build website
run: npm run build
working-directory: ./docs
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/build
deploy:
name: Deploy to GitHub Pages
if: github.event_name != 'pull_request'
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # verifies deployment is from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4