1717 # Replace HI with the ID of the instance in capital letters
1818 ARTIFACT : webHelpTL2-all.zip
1919 # Writerside docker image version
20- DOCKER_VERSION : 241.18775
20+ DOCKER_VERSION : 242.21870
21+ ALGOLIA_ARTIFACT : ' algolia-indexes-HI.zip'
22+ ALGOLIA_APP_NAME : ' CZXH99BXN1'
23+ ALGOLIA_INDEX_NAME : ' Writerside'
24+ ALGOLIA_KEY : ' ${{ secrets.ALGOLIA_KEY }}'
25+ CONFIG_JSON_PRODUCT : ' HI'
26+ CONFIG_JSON_VERSION : ' 1.0'
2127
2228jobs :
2329 build :
@@ -28,37 +34,31 @@ jobs:
2834 uses : actions/checkout@v4
2935 with :
3036 fetch-depth : 0
31-
3237 - name : Build Docs
3338 uses : JetBrains/writerside-github-action@v4
3439 with :
3540 instance : ${{ env.INSTANCE }}
3641 artifact : ${{ env.ARTIFACT }}
3742 docker-version : ${{ env.DOCKER_VERSION }}
38-
3943 - name : Upload Documentation
4044 uses : actions/upload-artifact@v4
4145 with :
4246 name : docs
4347 path : |
4448 artifacts/${{ env.ARTIFACT }}
4549 artifacts/report.json
50+ artifacts/${{ env.ALGOLIA_ARTIFACT }}
4651 retention-days : 7
4752
48- # Add the job below and artifacts/report.json on Upload documentation step
49- # above if you want to fail the build when documentation contains errors.
5053 test :
51- # Requires build job results
5254 needs : build
5355 runs-on : ubuntu-latest
54-
5556 steps :
5657 - name : Download Artifacts
5758 uses : actions/download-artifact@v4
5859 with :
5960 name : docs
6061 path : artifacts
61-
6262 - name : Test Documentation
6363 uses : JetBrains/writerside-checker-action@v1
6464 with :
@@ -68,26 +68,43 @@ jobs:
6868 environment :
6969 name : github-pages
7070 url : ${{ steps.deployment.outputs.page_url }}
71- # Requires the build job results
7271 needs : test
7372 runs-on : ubuntu-latest
7473 steps :
7574 - name : Download Artifact
7675 uses : actions/download-artifact@v4
7776 with :
7877 name : docs
79-
8078 - name : Unzip Artifact
8179 run : unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir
82-
8380 - name : Setup Pages
8481 uses : actions/configure-pages@v4
85-
8682 - name : Upload Artifact
8783 uses : actions/upload-pages-artifact@v3
8884 with :
8985 path : dir
90-
9186 - name : Deploy to GitHub Pages
9287 id : deployment
9388 uses : actions/deploy-pages@v4
89+
90+ publish-indexes :
91+ needs : [build, test, deploy]
92+ runs-on : ubuntu-latest
93+ container :
94+ image : registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3
95+ steps :
96+ - name : Download artifact
97+ uses : actions/download-artifact@v4
98+ with :
99+ name : docs
100+ - name : Unzip artifact
101+ run : |
102+ unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d algolia-indexes
103+ env algolia-key='${{env.ALGOLIA_KEY}}' java -jar /opt/builder/help-publication-agent.jar \
104+ update-index \
105+ --application-name '${{env.ALGOLIA_APP_NAME}}' \
106+ --index-name '${{env.ALGOLIA_INDEX_NAME}}' \
107+ --product '${{env.CONFIG_JSON_PRODUCT}}' \
108+ --version '${{env.CONFIG_JSON_VERSION}}' \
109+ --index-directory algolia-indexes/ \
110+ 2>&1 | tee algolia-update-index-log.txt
0 commit comments