Skip to content

Commit c44a2c1

Browse files
committed
Initial Commit
1 parent ace00c7 commit c44a2c1

18 files changed

+673
-0
lines changed

.github/workflows/build-docs.yml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: Build documentation
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
pages: write
12+
13+
env:
14+
INSTANCE: 'Writerside/t'
15+
DOCKER_VERSION: '243.22562'
16+
PDF: 'PDF.xml'
17+
ALGOLIA_APP_NAME: 'B4IMCNPNHK'
18+
ALGOLIA_INDEX_NAME: 'Tutoriales'
19+
CONFIG_JSON_PRODUCT: 't'
20+
CONFIG_JSON_VERSION: '2.0'
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
algolia_artifact: ${{ steps.define-ids.outputs.algolia_artifact }}
27+
artifact: ${{ steps.define-ids.outputs.artifact }}
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Define instance id and artifacts
35+
id: define-ids
36+
run: |
37+
INSTANCE=${INSTANCE#*/}
38+
INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]')
39+
ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip"
40+
ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip"
41+
42+
# Print the values
43+
echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER"
44+
echo "ARTIFACT: $ARTIFACT"
45+
echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT"
46+
47+
# Set the environment variables and outputs
48+
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
49+
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
50+
echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV
51+
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
52+
echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT
53+
54+
- name: Build docs using Writerside Docker builder
55+
uses: JetBrains/writerside-github-action@v4
56+
with:
57+
instance: ${{ env.INSTANCE }}
58+
docker-version: ${{ env.DOCKER_VERSION }}
59+
60+
- name: Save artifact with build results
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: docs
64+
path: |
65+
artifacts/${{ steps.define-ids.outputs.artifact }}
66+
artifacts/report.json
67+
artifacts/${{ steps.define-ids.outputs.algolia_artifact }}
68+
retention-days: 7
69+
test:
70+
needs: build
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Download artifacts
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: docs
77+
path: artifacts
78+
79+
- name: Test documentation
80+
uses: JetBrains/writerside-checker-action@v1
81+
with:
82+
instance: ${{ env.INSTANCE }}
83+
deploy:
84+
environment:
85+
name: github-pages
86+
url: ${{ steps.deployment.outputs.page_url }}
87+
needs: [build, test]
88+
runs-on: ubuntu-latest
89+
steps:
90+
- name: Download artifacts
91+
uses: actions/download-artifact@v4
92+
with:
93+
name: docs
94+
path: artifacts
95+
96+
- name: Unzip artifact
97+
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.artifact }}" -d dir
98+
99+
- name: Setup Pages
100+
uses: actions/configure-pages@v4
101+
102+
- name: Package and upload Pages artifact
103+
uses: actions/upload-pages-artifact@v3
104+
with:
105+
path: dir
106+
107+
- name: Deploy to GitHub Pages
108+
id: deployment
109+
uses: actions/deploy-pages@v4
110+
publish-indexes:
111+
needs: [build, test, deploy]
112+
runs-on: ubuntu-latest
113+
container:
114+
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3
115+
steps:
116+
- name: Download artifact
117+
uses: actions/download-artifact@v4
118+
with:
119+
name: docs
120+
path: artifacts
121+
- name: Unzip Algolia artifact
122+
run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.algolia_artifact }}" -d algolia-indexes
123+
- name: Update Algolia Index
124+
run: |
125+
if [ -z "${{ secrets.ALGOLIA_KEY }}" ]; then
126+
echo "ALGOLIA_KEY secret is not set in GitHub Secrets"
127+
exit 1
128+
else
129+
env "algolia-key=${{ secrets.ALGOLIA_KEY }}" java -jar /opt/builder/help-publication-agent.jar \
130+
update-index \
131+
--application-name ${{ env.ALGOLIA_APP_NAME }} \
132+
--index-name ${{ env.ALGOLIA_INDEX_NAME }} \
133+
--product ${{ env.CONFIG_JSON_PRODUCT }} \
134+
--version ${{ env.CONFIG_JSON_VERSION }} \
135+
--index-directory algolia-indexes/ \
136+
2>&1 | tee algolia-update-index-log.txt
137+
fi
138+
build-pdf:
139+
runs-on: ubuntu-latest
140+
steps:
141+
- name: Checkout repository
142+
uses: actions/checkout@v4
143+
with:
144+
fetch-depth: 0
145+
146+
- name: Define instance ID
147+
run: |
148+
INSTANCE_ID="${INSTANCE#*/}"
149+
INSTANCE_ID_UPPER=$(echo "$INSTANCE_ID" | tr '[:lower:]' '[:upper:]')
150+
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
151+
echo "Extracted ID: $INSTANCE_ID_UPPER"
152+
153+
- name: Build Writerside docs using Docker
154+
uses: JetBrains/writerside-github-action@v4
155+
with:
156+
instance: ${{ env.INSTANCE }}
157+
docker-version: ${{ env.DOCKER_VERSION }}
158+
pdf: ${{ env.PDF }}
159+
160+
- name: Upload artifact
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: artifact
164+
path: |
165+
artifacts/pdfSource${{ env.INSTANCE_ID_UPPER }}.pdf
166+
artifacts/pdfSource${{ env.INSTANCE_ID_UPPER }}.html
167+
retention-days: 7

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
.DS_STORE

Writerside/c.list

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE categories
3+
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
4+
<categories>
5+
<category id="wrs" name="Writerside documentation" order="1"/>
6+
</categories>

Writerside/cfg/PDF.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<pdf landscape="true">
2+
<cover-page>
3+
<title>My Awesome App</title>
4+
<description>User Guide</description>
5+
<copyright>Awesome Co © 2024</copyright>
6+
</cover-page>
7+
<header>Text in header</header>
8+
<footer>Text in footer</footer>
9+
<toc-title>Title for Table of Contents page</toc-title>
10+
<layout>Windows</layout>
11+
</pdf>

Writerside/cfg/buildprofiles.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE buildprofiles SYSTEM "https://resources.jetbrains.com/writerside/1.0/build-profiles.dtd">
3+
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
6+
<variables></variables>
7+
<build-profile instance="t">
8+
<variables>
9+
<noindex-content>true</noindex-content>
10+
</variables>
11+
</build-profile>
12+
13+
</buildprofiles>

Writerside/cfg/glossary.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE terms SYSTEM "https://resources.jetbrains.com/writerside/1.0/glossary.dtd">
3+
<terms>
4+
<term name="foo">
5+
Description of what "foo" is.
6+
</term>
7+
</terms>
125 KB
Loading
67.1 KB
Loading
341 KB
Loading
Loading

0 commit comments

Comments
 (0)