-
Notifications
You must be signed in to change notification settings - Fork 8
64 lines (60 loc) · 1.91 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: "Export terms to POEditor"
on:
push:
branches: [ main ]
paths-ignore:
- 'locales/**'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Build sphinx terms
uses: ammaraskar/[email protected]
env:
GITHUB_ACTIONS: 1
with:
docs-folder: "./"
pre-build-command: "apt-get update --allow-releaseinfo-change -y && apt-get install -y pandoc git && make fetchnotebooks && make buildtools && make fetchtranslation"
build-command: "sphinx-build -T -b gettext . _build"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poeditor
- name: Display the dir
run: ls -la ./_build
shell: bash
- name: CHMOD
run: sudo chmod a+rw ./_build/docs.pot
shell: bash
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: save-docs-pot
path: |
./_build/*.pot
- name: Upload terms
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: "715168"
run: |
python upload_terms.py
- name: Download terms poeditor
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: "715168"
run: |
# Run the download_terms.py script
python ./download_terms.py
# Stage the downloaded translation files
git add locales/fr/LC_MESSAGES/docs.po
# Check if there are any changes that are staged but not committed.
if [[ "$(git diff --cached --exit-code)" = "" ]]; then
echo "Nothing to commit, working tree clean";
else
# Commit the changes
git commit -m "Auto update deafrica-tools french translation files"
# Update the branch
git push
fi