Skip to content

Commit 8ae6be0

Browse files
authored
Add workflow to auto-generate wiki pages from XML files
1 parent edc7988 commit 8ae6be0

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Generate Wiki Pages from XML
2+
3+
on:
4+
push:
5+
paths:
6+
- 'translations/wiki/*.xml'
7+
branches:
8+
- main
9+
10+
jobs:
11+
generate-wiki:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout current branch (main)
16+
uses: actions/checkout@v4
17+
with:
18+
ref: main
19+
20+
- name: Save XML files for later use
21+
run: |
22+
mkdir -p tmp-xml
23+
cp -r translations/wiki/*.xml tmp-xml/
24+
25+
- name: Checkout 'webpage' branch
26+
uses: actions/checkout@v4
27+
with:
28+
ref: webpage_3.6
29+
path: webpage_3.6
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: 3.x
35+
36+
- name: Run Python script to generate markdown
37+
run: |
38+
python3 generate_wiki_pages_from_xml.py \
39+
--xml-dir=../tmp-xml \
40+
--output-dir=wiki/synchronization \
41+
--strings=synchronization_between_computers_title,synchronization_intro,set_up_first_pc,set_up_second_pc,bidirectional_sync,synchronization_files
42+
working-directory: ./webpage_3.6
43+
44+
- name: Commit and push changes to 'webpage' branch
45+
run: |
46+
cd webpage_3.6
47+
git config --global user.name "github-actions[bot]"
48+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
49+
git add wiki/synchronization/*.md
50+
git commit -m "Update wiki markdown from XML translations" || echo "No changes to commit"
51+
git push origin webpage_3.6

0 commit comments

Comments
 (0)