-
-
Notifications
You must be signed in to change notification settings - Fork 70
45 lines (42 loc) · 1.55 KB
/
update.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
# SPDX-FileCopyrightText: 2024 Nicco Kunzmann and Open Web Calendar Contributors <https://open-web-calendar.quelltext.eu/>
#
# SPDX-License-Identifier: GPL-2.0-only
# The purpose of this file is to keep this repository and its dependencies
# up-to-date.
name: "Update Repository"
on: [push]
# cancel builds in progress if a new push has been made to the same ref
# see https://stackoverflow.com/a/70972844/1320237
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update-translation-po-files:
name: Update Translation PO Files
runs-on: ubuntu-latest
if: github.ref_name == 'master'
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install tox
run: pip install tox
# run adding languages before the build to make sure that it succeeds
- name: Add missing languages
run: ./scripts/find-translated-documentation-languages.sh
- name: Build the documentation
run: tox -e docs -- build
- name: Check status
run: git status
- name: Push updates translation files
run: |
git config --global user.name 'OWC Github Actions'
git config --global user.email 'owc-github-actions@users.noreply.github.com'
git add open_web_calendar/translations mkdocs.yml
if git commit -m "Update translation files"; then
if ! git push; then
echo "ERROR: Push failed."
fi
fi