Deploy Docs #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Docs | |
| on: | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [docs-build] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build and Deploy Docs | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'zulu' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Cache Gradle wrapper | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }} | |
| - name: Fetch all tags | |
| run: git fetch --tags --force | |
| - name: Set Release Version in Docs | |
| run: | | |
| VERSION=$(cat gradle.properties | grep "version" | cut -d'=' -f2 | tr -d ' ') | |
| echo "Setting documentation version to $VERSION" | |
| sed -i "s/display_version: '.*'/display_version: '$VERSION'/" docs/content/antora.yml | |
| sed -i "s/redisvl-version: '.*'/redisvl-version: '$VERSION'/" docs/content/antora.yml | |
| - name: Generate Javadoc | |
| run: ./gradlew aggregateJavadoc --console=plain | |
| - name: Build Documentation | |
| run: ./gradlew :docs:build --console=plain | |
| - name: Add .nojekyll file | |
| run: touch docs/build/site/.nojekyll | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'docs/build/site' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |