Skip to content

Commit 9ecf642

Browse files
committed
chore: update writerside version and display algolia logo in search as required by free plan
1 parent 265d707 commit 9ecf642

File tree

2 files changed

+47
-13
lines changed

2 files changed

+47
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
# Replace HI with the ID of the instance in capital letters
2121
ARTIFACT: webHelpCCS2-all.zip
2222
# Writerside docker image version
23-
DOCKER_VERSION: 243.21565
23+
DOCKER_VERSION: 243.22562
2424

2525
# Add the variable below to upload Algolia indexes
2626
# Replace HI with the ID of the instance in capital letters
@@ -34,12 +34,35 @@ env:
3434
jobs:
3535
build:
3636
runs-on: ubuntu-latest
37+
outputs:
38+
algolia_artifact: ${{ steps.define-ids.outputs.algolia_artifact }}
39+
artifact: ${{ steps.define-ids.outputs.artifact }}
3740
steps:
3841
- name: Checkout repository
3942
uses: actions/checkout@v4
4043
with:
4144
fetch-depth: 0
4245

46+
- name: Define instance id and artifacts
47+
id: define-ids
48+
run: |
49+
INSTANCE=${INSTANCE#*/}
50+
INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]')
51+
ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip"
52+
ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip"
53+
54+
# Print the values
55+
echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER"
56+
echo "ARTIFACT: $ARTIFACT"
57+
echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT"
58+
59+
# Set the environment variables and outputs
60+
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
61+
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
62+
echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV
63+
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
64+
echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT
65+
4366
- name: Build docs using Writerside Docker builder
4467
uses: JetBrains/writerside-github-action@v4
4568
with:
@@ -87,9 +110,10 @@ jobs:
87110
uses: actions/download-artifact@v4
88111
with:
89112
name: docs
113+
path: artifacts
90114

91115
- name: Unzip artifact
92-
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d cf-pages
116+
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.artifact }}" -d cf-pages
93117

94118
- name: Publish to Cloudflare Pages
95119
uses: cloudflare/[email protected]
@@ -113,14 +137,23 @@ jobs:
113137
uses: actions/download-artifact@v4
114138
with:
115139
name: docs
116-
- name: Unzip artifact
140+
path: artifacts
141+
142+
- name: Unzip Algolia artifact
143+
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.algolia_artifact }}" -d algolia-indexes
144+
145+
- name: Update Algolia Index
117146
run: |
118-
unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d algolia-indexes
119-
env algolia-key='${{env.ALGOLIA_KEY}}' java -jar /opt/builder/help-publication-agent.jar \
120-
update-index \
121-
--application-name '${{env.ALGOLIA_APP_NAME}}' \
122-
--index-name '${{env.ALGOLIA_INDEX_NAME}}' \
123-
--product '${{env.CONFIG_JSON_PRODUCT}}' \
124-
--version '${{env.CONFIG_JSON_VERSION}}' \
125-
--index-directory algolia-indexes/ \
126-
2>&1 | tee algolia-update-index-log.txt
147+
if [ -z "${{ secrets.ALGOLIA_KEY }}" ]; then
148+
echo "ALGOLIA_KEY secret is not set in GitHub Secrets"
149+
exit 1
150+
else
151+
env "algolia-key=${{ secrets.ALGOLIA_KEY }}" java -jar /opt/builder/help-publication-agent.jar \
152+
update-index \
153+
--application-name ${{ env.ALGOLIA_APP_NAME }} \
154+
--index-name ${{ env.ALGOLIA_INDEX_NAME }} \
155+
--product ${{ env.CONFIG_JSON_PRODUCT }} \
156+
--version ${{ env.CONFIG_JSON_VERSION }} \
157+
--index-directory algolia-indexes/ \
158+
2>&1 | tee algolia-update-index-log.txt
159+
fi

Writerside/cfg/buildprofiles.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<algolia-index>docs_cast_crafter_community_server</algolia-index>
2020
<algolia-api-key>7cf09b7ca00ee35aefbe99fa74174ed6</algolia-api-key>
2121
<web-root>https://server.castcrafter.de/</web-root>
22+
<algolia-show-logo>true</algolia-show-logo>
2223

2324
<enable-contribution>true</enable-contribution>
2425
<contribute-url>https://github.com/Keviro/community-server-docs/blob/master/Writerside/</contribute-url>
@@ -34,7 +35,7 @@
3435
<sitemap priority="0.5" change-frequency="daily"/>
3536
</build-profile>
3637
<footer>
37-
<copyright>CastCrafter Community Server 2021-2024 | Not an official Minecraft Product. Not approved by or associated with Mojang or Microsoft</copyright>
38+
<copyright>CastCrafter Community Server 20212024 | Not an official Minecraft Product. Not approved by or associated with Mojang or Microsoft</copyright>
3839
<social type="youtube" href="https://www.youtube.com/@CastCrafter">
3940
YouTube
4041
</social>

0 commit comments

Comments
 (0)