-
-
Notifications
You must be signed in to change notification settings - Fork 75
83 lines (69 loc) · 2.25 KB
/
gh-pages.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: gh-pages
on:
push:
branches:
- master
schedule:
- cron: '30 1 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
translations:
runs-on: ubuntu-latest
if: (github.event_name == 'schedule' && github.repository == 'opengisch/QField-docs') || (github.event_name != 'schedule')
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python requirements
run: pip install -r requirements.txt
- name: Install Python requirements insiders
run: pip install -r requirements-insiders.txt
env:
MKDOCS_INSIDERS_TOKEN: ${{ secrets.MKDOCS_INSIDERS_TOKEN }}
- name: Install Transifex client
run: |
curl -OL https://github.com/transifex/cli/releases/download/v1.3.1/tx-linux-amd64.tar.gz
tar -xvzf tx-linux-amd64.tar.gz
- name: Configure Transifex
run: |
python ./utils/transifex_utils.py
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Push source files to Transifex
run: |
./tx push
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Pull translations from Transifex
run: |
./tx pull -t -l en,de,fr,it,es,zh,pt,ja
./tx status
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Build documentation
run: mkdocs build
env:
DEFAULT_LANGUAGE_ONLY: false
- name: Inject meta data to ensure proper font rendering for some translations
run: |
if [[ -d site/ja ]]
then
echo -e "social:\n cards_layout_options:\n font_family: Noto Sans JP" > site/ja/.meta.yml
echo "Successfully injected meta data into Japanese translation."
else
echo "*** Japanese translations not found in:"
echo "$(ls site)"
echo "*** Skipping this step."
fi
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
clean: true
folder: site