Skip to content

Commit dc1b0ab

Browse files
workflow: add automation of uploading source text to Crowdin
This will push to Crowdin if a push to main branch was successful. This allows automation of syncing source text, making it less of a hassle to synchronize all translations. Set preserve_hierarchy to avoid deviation from original integration behaviour.
1 parent fb72097 commit dc1b0ab

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/crowdin-upload.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Upload source files to Crowdin
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- 'docs/**.md'
8+
- 'docs/_include/**.md'
9+
- 'docs/.vitepress/i18n/strings/en_US.json'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
20+
submodules: recursive
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: npm
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
# This makes sure that the site actually builds before pushing to Crowdin
32+
- name: Build site
33+
run: npm run docs:build
34+
35+
- name: Push to Crowdin
36+
uses: crowdin/github-action@v2
37+
with:
38+
upload_sources: true
39+
crowdin_branch_name: master
40+
env:
41+
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}

crowdin.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
project_id: 240581
22
api_token_env: CROWDIN_TOKEN
3+
preserve_hierarchy: true
34

45
files:
56
- source: /docs/*.md

0 commit comments

Comments
 (0)