Skip to content

Commit bb4b901

Browse files
authored
move steps before po change
1 parent f8767dc commit bb4b901

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/publish.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ jobs:
4141
lektor plugins reinstall
4242
sudo apt update -y
4343
sudo apt install -y --no-install-recommends gettext
44+
- name: Setup Weblate Install and Configurations
45+
env:
46+
WEBLATE_API_TOKEN: ${{ secrets.WEBLATE_API_TOKEN }}
47+
run: |
48+
pip install wlc
49+
mkdir -p ~/.config && cat <<EOF > ~/.config/weblate
50+
[weblate]
51+
url = https://hosted.weblate.org/api/
52+
key = $WEBLATE_API_TOKEN
53+
translation = weblate/application
54+
EOF
55+
- name: Lock and Sync with Weblate
56+
wlc lock
57+
wlc push
58+
git pull origin
59+
4460
- name: Build site
4561
run: |
4662
lektor build --no-prune
@@ -60,24 +76,16 @@ jobs:
6076
GITHUB_TOKEN: ${{ github.token }}
6177
WEBLATE_API_TOKEN: ${{ secrets.WEBLATE_API_TOKEN }}
6278
run: |
63-
pip install wlc
64-
mkdir -p ~/.config && cat <<EOF > ~/.config/weblate
65-
[weblate]
66-
url = https://hosted.weblate.org/api/
67-
key = $WEBLATE_API_TOKEN
68-
translation = weblate/application
69-
EOF
70-
wlc lock
71-
wlc push
72-
git pull origin
73-
7479
# Commit the updated PO files.
7580
git add i18n
7681
git commit -m "Update translations to $(git rev-parse --short HEAD)."
7782
git push origin
7883
84+
- name: Unlock Weblate and Remove Configuration
85+
run: |
7986
wlc push
8087
wlc unlock
88+
rm ~/.config/weblate
8189
8290
- name: Publish site
8391
env:

0 commit comments

Comments
 (0)