Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 39 additions & 31 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,34 +104,42 @@ jobs:
#wranglerVersion: 3.101.0

# see: https://youtrack.jetbrains.com/issue/WRS-7233/Algolia-publisher-2.0.32-3-fails-with-UnrecognizedPropertyException-for-contentBoost-field-generated-by-Writerside-builder
# publish-indexes:
# needs: [ build, test, deploy ]
# runs-on: ubuntu-latest
# container:
# image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:latest
#
# 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 }} \
# --version ${{ env.CONFIG_JSON_VERSION }} \
# --index-directory algolia-indexes/ \
# 2>&1 | tee algolia-update-index-log.txt
# fi
publish-indexes:
needs: [ build, test, deploy ]
runs-on: ubuntu-latest
container:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:latest

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: Remove contentBoost field from index files
run: |
cd algolia-indexes
shopt -s nullglob
for f in *.json; do
Comment on lines +123 to +127
sed -i -E 's/"contentBoost":[0-9]+,//g; s/,"contentBoost":[0-9]+//g' "$f"
done

Comment on lines +125 to +130
- 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 }} \
--version ${{ env.CONFIG_JSON_VERSION }} \
--index-directory algolia-indexes/ \
2>&1 | tee algolia-update-index-log.txt
fi
Loading