|
1 | 1 | name: build |
2 | 2 | on: |
3 | 3 | push: |
4 | | - branches: [ main ] |
| 4 | + branches: [ main, develop, gh-build ] |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: ${{ github.ref }} |
| 8 | + cancel-in-progress: true |
5 | 9 |
|
6 | 10 | jobs: |
7 | | - install-tools: |
| 11 | + full-build: |
8 | 12 | runs-on: ubuntu-latest |
9 | 13 | container: |
10 | 14 | image: sphinxdoc/sphinx |
11 | | - # #volumes: |
12 | | - # # - ${{ github.workspace }}/:/docs |
13 | 15 | volumes: |
14 | 16 | - /home/dariball/dev/nitrokey-documentation/result:/result |
15 | 17 | defaults: |
16 | 18 | run: |
17 | 19 | working-directory: ${{ github.workspace }} |
18 | 20 | env: |
19 | | - MAIN_LANGS: en de |
20 | | - 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 |
| 21 | + MAIN_LANGS: en |
| 22 | + 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 |
| 23 | + |
21 | 24 | steps: |
22 | 25 | - name: Checkout |
23 | 26 | uses: actions/checkout@v2 |
24 | | - #- name: check if container runs |
25 | | - # run: ls / |
26 | | - #- name: more stuff |
27 | | - # run: echo "whooot" ${{ github.workspace }} |
28 | | - #- name: show docs |
29 | | - # run: ls -la /docs |
30 | | - #- name: show workspace |
31 | | - # run: ls -la ${{ github.workspace }} |
| 27 | + |
32 | 28 | - name: additional sphinx install |
33 | 29 | run: pip3 install -r requirements.txt |
34 | 30 |
|
35 | | - #- name: build workspace |
36 | | - # run: | |
37 | | - # mkdir /work |
38 | | - |
| 31 | + - name: quick build docs |
| 32 | + run: | |
| 33 | + mkdir -p dist/en |
| 34 | + mkdir -p build/en/doctrees |
| 35 | + sphinx-build -j auto -b html -D language=en -d build/en/doctrees source dist/en |
| 36 | +
|
| 37 | + - name: LOCAL ONLY - copy generated |
| 38 | + run: cp -r dist /result/quick |
| 39 | + |
| 40 | + - name: upload quick build artifact |
| 41 | + uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: generated documentation (en) |
| 44 | + path: dist |
| 45 | + |
| 46 | + - name: TODO - trigger script on server to download artifact |
| 47 | + run: echo "placeholder" |
| 48 | + |
39 | 49 | - name: build pot files |
40 | 50 | run: sphinx-build -b gettext source locales/ |
41 | 51 |
|
42 | 52 | - name: build po files from pot files |
43 | 53 | shell: bash |
44 | 54 | run: | |
45 | | - lang=($MAIN_LANGS $OTHER_LANGS) |
| 55 | + lang=($OTHER_LANGS) |
46 | 56 | sphinx-intl update -p locales/ ${lang[@]/*/'-l '&' '} |
47 | 57 |
|
48 | | - - name: build docs |
| 58 | + - name: prepare commit into self |
| 59 | + run: | |
| 60 | + cp -r locales locales.full |
| 61 | + rm -rf locales/.doctrees |
| 62 | +
|
| 63 | + - name: TODO - commit locales into repository |
| 64 | + run: echo "commit it" |
| 65 | + |
| 66 | + - name: put original locales back |
| 67 | + run: | |
| 68 | + rm -rf locales |
| 69 | + cp -r locales.full locales |
| 70 | +
|
| 71 | + - name: TODO - weblate |
49 | 72 | run: | |
50 | | - cp -r locales source |
| 73 | + echo "trigger pull" |
| 74 | + echo "trigger deepl" |
| 75 | + echo "trigger commit" |
| 76 | + echo "trigger push" |
| 77 | +
|
| 78 | + - name: build full docs |
| 79 | + run: | |
| 80 | + cp -r locales source/locales |
51 | 81 | for lang in $MAIN_LANGS $OTHER_LANGS |
52 | 82 | do |
53 | 83 | mkdir -p dist/$lang |
54 | 84 | mkdir -p build/$lang/doctrees |
55 | 85 | sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source dist/$lang |
56 | 86 | done |
57 | 87 |
|
| 88 | + - name: LOCAL - copy generated |
| 89 | + run: cp -r dist locales build /result |
| 90 | + |
| 91 | + - name: upload artifact |
| 92 | + uses: actions/upload-artifact@v4 |
| 93 | + with: |
| 94 | + name: generated documentation (all) |
| 95 | + path: dist |
58 | 96 |
|
59 | | - - name: copy generated |
60 | | - run: | |
61 | | - cp -r dist locales build /result |
62 | | - # bash |
| 97 | + |
0 commit comments