Add files via upload #319
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |