-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (51 loc) · 1.73 KB
/
translations.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
name: Compile translations
on:
push:
branches:
- develop
paths:
- 'translations/**'
jobs:
run-translate:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install GNU gettext tools
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Compile translations
run: |
python manage.py translate
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Check for changes
run: |
git add .
if git diff --cached --quiet; then
echo "No changes to commit; exiting."
exit 0
fi
git commit -m "Compile localisation updates"
- name: Push changes
if: success()
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}