Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ jobs:
lektor plugins reinstall
sudo apt update -y
sudo apt install -y --no-install-recommends gettext
- name: Setup Weblate Install and Configurations
env:
WEBLATE_API_TOKEN: ${{ secrets.WEBLATE_API_TOKEN }}
run: |
pip install wlc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't version locked; we should just add wlc to the site requirements.

mkdir -p ~/.config && cat <<EOF > ~/.config/weblate
[weblate]
url = https://hosted.weblate.org/api/
key = $WEBLATE_API_TOKEN
translation = weblate/application
EOF
- name: Lock and Sync with Weblate
run: |
wlc commit
wlc lock
wlc push
git pull origin

- name: Build site
run: |
lektor build --no-prune
Expand All @@ -64,6 +82,12 @@ jobs:
git commit -m "Update translations to $(git rev-parse --short HEAD)."
git push origin

- name: Unlock Weblate and Remove Configuration
run: |
wlc pull
wlc unlock
rm ~/.config/weblate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to do cleanup like this; if anything, it's better to leave a config like this around so that we can diagnose problems later.

Suggested change
rm ~/.config/weblate

We should probably also split this into two parts - the pull (which is only needed if there have been updates), and the unlock (which is always needed).


- name: Publish site
env:
LEKTOR_DEPLOY_USERNAME: brutusthebee
Expand Down