Skip to content

Commit e2a96cb

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.
1 parent fb72097 commit e2a96cb

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
21+
- name: Setup Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: npm
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
# This makes sure that the site actually builds before pushing to Crowdin
31+
- name: Build site
32+
run: npm run docs:build
33+
34+
- name: Push to Crowdin
35+
uses: crowdin/github-action@v2
36+
with:
37+
upload_sources: true
38+
upload_translations: false
39+
download_translations: false
40+
crowdin_branch_name: ${{ env.BRANCH_NAME }}
41+
env:
42+
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}

0 commit comments

Comments
 (0)