-
-
Notifications
You must be signed in to change notification settings - Fork 18
88 lines (74 loc) · 2.5 KB
/
doc.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
84
85
86
87
88
name: doc
on:
pull_request:
branches:
- master
paths:
- 'docs/**'
- '.github/workflows/doc.yml'
push:
branches:
- master
paths:
- 'docs/**'
- '.github/workflows/doc.yml'
workflow_dispatch: # useful for testing tx pushes
defaults:
run:
working-directory: docs
jobs:
deploy:
runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python requirements
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Install Transifex client
run: |
curl -OL https://github.com/transifex/cli/releases/download/v1.6.10/tx-linux-amd64.tar.gz
tar -xvzf tx-linux-amd64.tar.gz
- name: Extract translatable content from mkdocs.yml config
run: ./scripts/mkdocs_tx.py create_source
- name: Configure Transifex
run: scripts/transifex_utils.py
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Push source files to Transifex
if: ${{ github.event_name != 'pull_request' }}
run: ./tx push
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Pull translations from Transifex
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || ${{ github.event_name == 'pull_request' && github.repository == 'opengisch/QgisModelBaker' }}
run: |
./tx pull --translations --all --minimum-perc 10
./tx status
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Translate Mkdocs config
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || ${{ github.event_name == 'pull_request' && github.repository == 'opengisch/QgisModelBaker' }}
run: |
./scripts/mkdocs_tx.py -s en update_config
./scripts/mkdocs_tx_commit.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build documentation
run: mkdocs build
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: docs
path: docs/site
if-no-files-found: error
- name: Deploy to GitHub Pages
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
run: mkdocs gh-deploy --force