From ed2ff16dd6605845fbe47b2b6a7f8f7efe38c8c9 Mon Sep 17 00:00:00 2001 From: maxDorninger <97409287+maxDorninger@users.noreply.github.com> Date: Mon, 28 Jul 2025 21:25:57 +0200 Subject: [PATCH] add algolia deploy step and env variables to gh workflow --- .github/workflows/build-docs.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 55c9cd5..e123a2f 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -16,6 +16,9 @@ permissions: env: INSTANCE: 'Writerside/mm' DOCKER_VERSION: '2025.04.8412' + ALGOLIA_APP_NAME: '5SXJTW5J6S' + ALGOLIA_INDEX_NAME: 'MediaManager Docs' + CONFIG_JSON_PRODUCT: 'MM' jobs: build: @@ -105,3 +108,30 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + publish-indexes: + needs: [ build, test, deploy ] + runs-on: ubuntu-latest + container: + image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3 + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: docs + path: artifacts + - name: Unzip Algolia artifact + run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.algolia_artifact }}" -d algolia-indexes + - name: Update Algolia Index + run: | + if [ -z "${{ secrets.ALGOLIA_KEY }}" ]; then + echo "ALGOLIA_KEY secret is not set in GitHub Secrets" + exit 1 + else + env "algolia-key=${{ secrets.ALGOLIA_KEY }}" java -jar /opt/builder/help-publication-agent.jar \ + update-index \ + --application-name ${{ env.ALGOLIA_APP_NAME }} \ + --index-name ${{ env.ALGOLIA_INDEX_NAME }} \ + --product ${{ env.CONFIG_JSON_PRODUCT }} \ + --index-directory algolia-indexes/ \ + 2>&1 | tee algolia-update-index-log.txt + fi