Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit 58de4fe

Browse files
committed
Update Writerside again
1 parent 78ec0c8 commit 58de4fe

File tree

3 files changed

+79
-26
lines changed

3 files changed

+79
-26
lines changed

.github/workflows/deploy.yml

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,30 @@ name: 🚀 Despliegue documentación
66

77
on:
88
push:
9-
paths: ["docs/**"]
10-
branches: ["main"]
9+
paths: [ "docs/**" ]
10+
branches: [ "main" ]
1111
workflow_dispatch:
1212

1313
permissions:
14+
contents: read
1415
id-token: write
1516
pages: write
1617

1718
env:
1819
INSTANCE: 'docs/pro'
19-
ARTIFACT: 'webHelpPRO2-all.zip'
20-
DOCKER_VERSION: '243.21565'
21-
ALGOLIA_ARTIFACT: 'algolia-indexes-PRO.zip'
20+
DOCKER_VERSION: '243.22562'
2221
ALGOLIA_APP_NAME: '0K3UBN277V'
2322
ALGOLIA_INDEX_NAME: 'pro2324'
24-
ALGOLIA_KEY: '${{ secrets.ALGOLIA_KEY }}'
2523
CONFIG_JSON_PRODUCT: 'PRO'
2624
CONFIG_JSON_VERSION: '1.0'
2725

2826
jobs:
2927
construir:
3028
name: 📦 Construir
3129
runs-on: ubuntu-latest
30+
outputs:
31+
algolia_artifact: ${{ steps.define-ids.outputs.algolia_artifact }}
32+
artifact: ${{ steps.define-ids.outputs.artifact }}
3233
steps:
3334
- name: ⬇️ Checkout repositorio
3435
# GitHub Actions
@@ -38,6 +39,26 @@ jobs:
3839
with:
3940
fetch-depth: 0
4041

42+
- name: ✳️ Define instance id and artifacts
43+
id: define-ids
44+
run: |
45+
INSTANCE=${INSTANCE#*/}
46+
INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]')
47+
ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip"
48+
ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip"
49+
50+
# Print the values
51+
echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER"
52+
echo "ARTIFACT: $ARTIFACT"
53+
echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT"
54+
55+
# Set the environment variables and outputs
56+
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
57+
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
58+
echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV
59+
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
60+
echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT
61+
4162
- name: 🏗️ Construir con Writerside usando Docker
4263
# JetBrains Open Source
4364
# Apache-2.0
@@ -89,7 +110,7 @@ jobs:
89110
environment:
90111
name: github-pages
91112
url: ${{ steps.deployment.outputs.page_url }}
92-
needs: [construir, comprobar]
113+
needs: [ construir, comprobar ]
93114
runs-on: ubuntu-latest
94115
steps:
95116
- name: ⬇️ Descargar artefacto
@@ -99,9 +120,10 @@ jobs:
99120
uses: actions/download-artifact@v4
100121
with:
101122
name: docs
123+
path: artifacts
102124

103125
- name: 🗃️ Descomprimir artefacto
104-
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d dir
126+
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.artifact }}" -d dir
105127

106128
- name: 🔎 Configurar IndexNow
107129
run: echo ${{ secrets.INDEXNOW_KEY }} > dir/${{ secrets.INDEXNOW_KEY }}.txt
@@ -110,9 +132,9 @@ jobs:
110132
run: |
111133
curl https://raw.githubusercontent.com/TeenBiscuits/Pro2324/main/docs/cfg/robots.txt -o dir/robots.txt && \
112134
curl https://raw.githubusercontent.com/TeenBiscuits/Pro2324/main/docs/cfg/humans.txt -o dir/humans.txt
113-
135+
114136
- name: 🔩 Configurar Pages
115-
uses: actions/configure-pages@v5
137+
uses: actions/configure-pages@v4
116138

117139
- name: 📦 Empaquetar y subir artefacto de Pages
118140
uses: actions/upload-pages-artifact@v3
@@ -129,7 +151,7 @@ jobs:
129151
publicar-indexes:
130152
name: 🔎 Algolia Index
131153
if: github.repository == 'TeenBiscuits/Pro2324'
132-
needs: [construir, comprobar, publicar]
154+
needs: [ construir, comprobar, publicar ]
133155
runs-on: ubuntu-latest
134156
container:
135157
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3
@@ -141,20 +163,27 @@ jobs:
141163
uses: actions/download-artifact@v4
142164
with:
143165
name: docs
166+
path: artifacts
144167
- name: 🗃️ Descomprimir artefacto
168+
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.algolia_artifact }}" -d algolia-indexes
169+
- name: 🆙 Update Algolia Index
145170
run: |
146-
unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d algolia-indexes
147-
env algolia-key='${{env.ALGOLIA_KEY}}' java -jar /opt/builder/help-publication-agent.jar \
148-
update-index \
149-
--application-name '${{env.ALGOLIA_APP_NAME}}' \
150-
--index-name '${{env.ALGOLIA_INDEX_NAME}}' \
151-
--product '${{env.CONFIG_JSON_PRODUCT}}' \
152-
--version '${{env.CONFIG_JSON_VERSION}}' \
153-
--index-directory algolia-indexes/ \
154-
2>&1 | tee algolia-update-index-log.txt
171+
if [ -z "${{ secrets.ALGOLIA_KEY }}" ]; then
172+
echo "ALGOLIA_KEY secret is not set in GitHub Secrets"
173+
exit 1
174+
else
175+
env "algolia-key=${{ secrets.ALGOLIA_KEY }}" java -jar /opt/builder/help-publication-agent.jar \
176+
update-index \
177+
--application-name ${{ env.ALGOLIA_APP_NAME }} \
178+
--index-name ${{ env.ALGOLIA_INDEX_NAME }} \
179+
--product ${{ env.CONFIG_JSON_PRODUCT }} \
180+
--version ${{ env.CONFIG_JSON_VERSION }} \
181+
--index-directory algolia-indexes/ \
182+
2>&1 | tee algolia-update-index-log.txt
183+
fi
155184
156185
indexnow:
157-
needs: [construir, comprobar, publicar]
186+
needs: [ construir, comprobar, publicar ]
158187
name: 🔎 Bing IndexNow
159188
if: github.repository == 'TeenBiscuits/Pro2324'
160189
runs-on: ubuntu-latest
@@ -172,7 +201,7 @@ jobs:
172201
failure-strategy: error
173202

174203
google-indexing:
175-
needs: [construir, comprobar, publicar]
204+
needs: [ construir, comprobar, publicar ]
176205
name: 🔎 Google Index
177206
if: github.repository == 'TeenBiscuits/Pro2324'
178207
runs-on: ubuntu-latest

.github/workflows/tests.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@ name: 🔬 Comprobar documentación
66

77
on:
88
pull_request:
9-
types: ["opened"]
10-
paths: ["docs/**"]
9+
types: [ "opened" ]
10+
paths: [ "docs/**" ]
1111
workflow_dispatch:
1212

1313
permissions:
14+
contents: read
1415
id-token: write
1516
pages: write
1617

1718
env:
1819
INSTANCE: 'docs/pro'
19-
ARTIFACT: 'webHelpPRO2-all.zip'
20-
DOCKER_VERSION: '243.21565'
20+
DOCKER_VERSION: '243.22562'
2121

2222
jobs:
2323
construir:
2424
name: 📦 Construir
2525
runs-on: ubuntu-latest
26+
outputs:
27+
algolia_artifact: ${{ steps.define-ids.outputs.algolia_artifact }}
28+
artifact: ${{ steps.define-ids.outputs.artifact }}
2629
steps:
2730
- name: ⬇️ Checkout repositorio
2831
# GitHub Actions
@@ -32,6 +35,26 @@ jobs:
3235
with:
3336
fetch-depth: 0
3437

38+
- name: ✳️ Define instance id and artifacts
39+
id: define-ids
40+
run: |
41+
INSTANCE=${INSTANCE#*/}
42+
INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]')
43+
ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip"
44+
ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip"
45+
46+
# Print the values
47+
echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER"
48+
echo "ARTIFACT: $ARTIFACT"
49+
echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT"
50+
51+
# Set the environment variables and outputs
52+
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
53+
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
54+
echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV
55+
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
56+
echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT
57+
3558
- name: 🏗️ Construir con Writerside usando Docker
3659
# JetBrains Open Source
3760
# Apache-2.0

docs/cfg/buildprofiles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SPDX-License-Identifier: GPL-3.0-only
2424
<algolia-id>0K3UBN277V</algolia-id>
2525
<algolia-index>pro2324</algolia-index>
2626
<algolia-api-key>d4e81705240b4f5de1022e3a86236964</algolia-api-key>
27+
<algolia-show-logo>true</algolia-show-logo>
2728
<!-- ANALYTICS AND COOKIE BANNER -->
2829
<analytics-head-script-file>analytics.js</analytics-head-script-file>
2930
<!-- EDIT GITHUB -->

0 commit comments

Comments
 (0)