Skip to content

gh-pages

gh-pages #861

Workflow file for this run

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/[email protected]
with:
branch: gh-pages
clean: true
folder: site