From fe5e2db59f25a8dbfa54b171e5ab406bc1e59ffa Mon Sep 17 00:00:00 2001 From: "Clayton T." <34910888+CommandrMoose@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:00:21 +1000 Subject: [PATCH] Deploy and update --- .github/workflows/build-docs.yml | 35 +++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index b517de3..2bef94d 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -5,10 +5,22 @@ on: branches: ["main"] workflow_dispatch: +permissions: + id-token: write + pages: write + + + env: INSTANCE: 'Writerside/tr' ARTIFACT: 'webHelpTR2-all.zip' DOCKER_VERSION: '241.15989' + ALGOLIA_ARTIFACT: 'algolia-indexes-TR.zip' + ALGOLIA_APP_NAME: 'NLAGB2LZHU' + ALGOLIA_INDEX_NAME: 'MY_INDEX' + ALGOLIA_KEY: '${{ secrets.ALGOLIA_KEY }}' + CONFIG_JSON_PRODUCT: 'TR' + CONFIG_JSON_VERSION: '1.0' jobs: build: @@ -71,4 +83,25 @@ jobs: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + 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 + - name: Unzip artifact + run: | + unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d algolia-indexes + env algolia-key='${{env.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}}' \ + --version '${{env.CONFIG_JSON_VERSION}}' \ + --index-directory algolia-indexes/ \ + 2>&1 | tee algolia-update-index-log.txt \ No newline at end of file