add algolia deploy step and env variables to gh workflow

This commit is contained in:
maxDorninger
2025-07-28 21:25:57 +02:00
parent b2635cc650
commit ed2ff16dd6

View File

@@ -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