-
Notifications
You must be signed in to change notification settings - Fork 40
53 lines (47 loc) · 1.38 KB
/
docs.yaml
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
name: doc
on:
push:
branches:
- docs
- master
paths:
- 'docs/**'
jobs:
deploy:
runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Requirements
run: |
sudo apt-get update && sudo apt-get install -y transifex-client
sudo pip install mkdocs-material mkdocs-static-i18n==0.31
- name: Push translations
if: ${{ github.ref == 'refs/heads/master' }}
run: |
set -e
if [[ -z "${TX_TOKEN}" ]]; then
echo "TX_TOKEN not set, skip tx push"
else
echo "Create .tx/config mapping."
tx config mapping-bulk -p slyr-docs --source-language en --type GITHUBMARKDOWN -f '.md' --source-file-dir docs --expression "docs/{filepath}/{filename}.<lang>{extension}" --execute
echo "Push source files."
tx push -s -d
fi
- name: Pull translations
run: |
set -e
if [[ -z "${TX_TOKEN}" ]]; then
echo "TX_TOKEN not set, skip tx pull"
else
echo "Pull translations."
tx pull -a
fi
- name: Build docs
run: mkdocs gh-deploy --force