Skip to content

Commit 2f64da9

Browse files
committed
Add algolia search
1 parent 18fb8d6 commit 2f64da9

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

.github/workflows/deploy.yml

+30-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ env:
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

2228
jobs:
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

Writerside/cfg/buildprofiles.xml

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<enable-contribution>true</enable-contribution>
2626
<contribute-url>https://github.com/php-type-language/docs/blob/master/Writerside/</contribute-url>
2727
<custom-css>custom.css</custom-css>
28+
29+
<algolia-id>CZXH99BXN1</algolia-id>
30+
<algolia-index>Writerside</algolia-index>
31+
<algolia-api-key>70b2d5249859c00508d22cb54c52eeee</algolia-api-key>
2832
</variables>
2933

3034
<icons>

0 commit comments

Comments
 (0)