From d7865968cf84feab18ec7f0a6c9ae209219b4335 Mon Sep 17 00:00:00 2001 From: Markus Meissner Date: Sat, 23 Nov 2024 18:13:40 +0100 Subject: [PATCH] first shot --- .github/workflows/build.yml | 62 +++++++++++++++++++++++++++++++++++++ requirements.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..5bf3d92fb4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,62 @@ +name: build +on: + push: + branches: [ main ] + +jobs: + install-tools: + runs-on: ubuntu-latest + container: + image: sphinxdoc/sphinx + # #volumes: + # # - ${{ github.workspace }}/:/docs + volumes: + - /home/dariball/dev/nitrokey-documentation/result:/result + defaults: + run: + working-directory: ${{ github.workspace }} + env: + MAIN_LANGS: en de + OTHER_LANGS: es fr ru nl it ja el bg da et fi lv lt pl pt ro sv sk sl cs hu zh_CN + steps: + - name: Checkout + uses: actions/checkout@v2 + #- name: check if container runs + # run: ls / + #- name: more stuff + # run: echo "whooot" ${{ github.workspace }} + #- name: show docs + # run: ls -la /docs + #- name: show workspace + # run: ls -la ${{ github.workspace }} + - name: additional sphinx install + run: pip3 install -r requirements.txt + + #- name: build workspace + # run: | + # mkdir /work + + - name: build pot files + run: sphinx-build -b gettext source locales/ + + - name: build po files from pot files + shell: bash + run: | + lang=($MAIN_LANGS $OTHER_LANGS) + sphinx-intl update -p locales/ ${lang[@]/*/'-l '&' '} + + - name: build docs + run: | + cp -r locales source + for lang in $MAIN_LANGS $OTHER_LANGS + do + mkdir -p dist/$lang + mkdir -p build/$lang/doctrees + sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source dist/$lang + done + + + - name: copy generated + run: | + cp -r dist locales build /result + # bash diff --git a/requirements.txt b/requirements.txt index 33001d12f2..5fd4cd8076 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ soupsieve==2.4.1 Sphinx==6.2.1 sphinx-basic-ng==1.0.0b1 sphinx-copybutton==0.5.2 -sphinx-intl==2.2.0 +sphinx-intl==2.3.0 sphinx-tabs==3.4.1 sphinxcontrib-applehelp==1.0.4 sphinxcontrib-devhelp==1.0.2