From 8101ed8716f442f61ae677c984f28a6c7e0af27c Mon Sep 17 00:00:00 2001 From: Markus Meissner Date: Sat, 23 Nov 2024 20:26:47 +0100 Subject: [PATCH] try-out --- .github/workflows/build.yml | 85 ++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bf3d92fb4..5f51fae71f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,53 +1,83 @@ name: build on: push: - branches: [ main ] + branches: [ main, develop, gh-build ] + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: - install-tools: + full-build: 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 + MAIN_LANGS: en + OTHER_LANGS: de 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: quick build docs + run: | + mkdir -p dist/en + mkdir -p build/en/doctrees + sphinx-build -j auto -b html -D language=en -d build/en/doctrees source dist/en + + - name: LOCAL ONLY - copy generated + run: cp -r dist /result/quick + + - name: upload quick build artifact + uses: actions/upload-artifact@v4 + with: + name: generated documentation (en) + path: dist + + - name: TODO - trigger script on server to download artifact + run: echo "placeholder" + - 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) + lang=($OTHER_LANGS) sphinx-intl update -p locales/ ${lang[@]/*/'-l '&' '} - - name: build docs + - name: prepare commit into self + run: | + cp -r locales locales.full + rm -rf locales/.doctrees + + - name: TODO - commit locales into repository + run: echo "commit it" + + - name: put original locales back + run: | + rm -rf locales + cp -r locales.full locales + + - name: TODO - weblate run: | - cp -r locales source + echo "trigger pull" + echo "trigger deepl" + echo "trigger commit" + echo "trigger push" + + - name: build full docs + run: | + cp -r locales source/locales for lang in $MAIN_LANGS $OTHER_LANGS do mkdir -p dist/$lang @@ -55,8 +85,13 @@ jobs: sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source dist/$lang done + - name: LOCAL - copy generated + run: cp -r dist locales build /result + + - name: upload artifact + uses: actions/upload-artifact@v4 + with: + name: generated documentation (all) + path: dist - - name: copy generated - run: | - cp -r dist locales build /result - # bash +