Skip to content

Commit 69d8495

Browse files
committed
sphinx build as gh action
1 parent 6e42eff commit 69d8495

File tree

4 files changed

+136
-1
lines changed

4 files changed

+136
-1
lines changed

.github/workflows/build.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: build
2+
on:
3+
push:
4+
branches: [ main, develop, gh-build ]
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
# runs on weblate commit
11+
weblate-commit-build:
12+
if: ${{ contains(github.event.head_commit.message, 'Translated using Weblate') }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: TODO - start full build (delayed)
16+
run: echo "TODO - start delayed full build, maybe 15mins?"
17+
18+
# on regular commit (auto excludes self-commited pot/po files)
19+
full-build:
20+
if: ${{ ! contains(github.event.head_commit.message, 'Translated using Weblate') }}
21+
concurrency:
22+
group: ${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
runs-on: ubuntu-latest
26+
container:
27+
image: sphinxdoc/sphinx
28+
#options: --user 1001 (only if we don't need apt-get)
29+
30+
env:
31+
MAIN_LANGS: en
32+
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
33+
34+
steps:
35+
- name: Install git
36+
run: |
37+
apt-get -y update
38+
apt-get -y install git ssh curl
39+
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: additional python packages
44+
run: pip3 install -r requirements.txt
45+
46+
- name: quick build docs
47+
run: |
48+
mkdir -p dist/en
49+
mkdir -p build/en/doctrees
50+
sphinx-build -j auto -b html -D language=en -d build/en/doctrees source dist/en
51+
# remove/cleanup dist/en/_sources
52+
53+
- name: upload quick build artifact
54+
id: upload-quick
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: generated documentation (en)
58+
path: dist
59+
60+
- name: TODO - trigger script on server to download artifact
61+
run: echo 'Artifact URL is ${{ steps.upload-quick.outputs.artifact-url }}'
62+
63+
- name: trigger docs server to download artifact
64+
uses: appleboy/[email protected]
65+
with:
66+
host: ${{ secrets.DOCS_HOST }}
67+
username: docs
68+
port: ${{ secrets.DOCS_PORT }}
69+
key: ${{ secrets.DEPLOY_AUTH_KEY }}
70+
script: /var/www/docs/deploy/github-trigger.sh en ${{ steps.upload-quick.outputs.artifact-id }} ${{ secrets.DOWNLOAD_TOKEN }}
71+
72+
- name: build pot files
73+
run: sphinx-build -b gettext source locales/
74+
75+
- name: build po files from pot files
76+
shell: bash
77+
run: |
78+
lang=($OTHER_LANGS)
79+
sphinx-intl update -p locales/ ${lang[@]/*/'-l '&' '}
80+
81+
- name: prepare commit into self
82+
run: |
83+
cp -r locales locales.full
84+
rm -rf locales/.doctrees
85+
86+
- name: commit `locales` into repository (on changes)
87+
shell: bash
88+
run: |
89+
# not needed if run on --user 1001
90+
git config --global --add safe.directory $(pwd)
91+
git config --global user.name "GitHub Action"
92+
git config --global user.email "[email protected]"
93+
if (git commit -m "Automated locales generation" locales); then
94+
git push
95+
fi
96+
97+
- name: put original `locales` back
98+
run: |
99+
rm -rf locales
100+
cp -r locales.full locales
101+
102+
- name: TODO - weblate
103+
run: |
104+
echo "trigger pull"
105+
echo "trigger deepl"
106+
echo "trigger commit"
107+
echo "trigger push"
108+
109+
- name: build full docs
110+
run: |
111+
cp -r locales source/locales
112+
for lang in $MAIN_LANGS $OTHER_LANGS
113+
do
114+
mkdir -p dist/$lang
115+
mkdir -p build/$lang/doctrees
116+
sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source dist/$lang
117+
# remove/cleanup dist/$lang/_sources
118+
done
119+
120+
121+
- name: upload full build artifact
122+
id: upload-full
123+
uses: actions/upload-artifact@v4
124+
with:
125+
name: generated documentation (all)
126+
path: dist
127+
128+
- name: TODO - trigger script on server to download FULL artifact
129+
run: echo 'Artifact URL is ${{ steps.upload-full.outputs.artifact-url }}'
130+
131+

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ soupsieve==2.4.1
1818
Sphinx==6.2.1
1919
sphinx-basic-ng==1.0.0b1
2020
sphinx-copybutton==0.5.2
21-
sphinx-intl==2.2.0
21+
sphinx-intl==2.3.0
2222
sphinx-tabs==3.4.1
2323
sphinxcontrib-applehelp==1.0.4
2424
sphinxcontrib-devhelp==1.0.2

source/components/software/nitropy/linux/udev.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ After installing the rules, you need to reload them::
2323
If you still cannot access your device, try again after rebooting your system.
2424
If you encouter issues, look at this `github comment <https://github.com/Nitrokey/pynitrokey/issues/167#issuecomment-1024921046>`__
2525
for some debugging hints.
26+
27+
todo: more details

to-be-integrated.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33

44

5+
6+
57
PKCS#11 Driver
68

79
If you want to use S/MIME email encryption with Thunderbird, to use TrueCrypt/VeraCrypt, certificate-based SSL authentication with Firefox, PuTTY/KiTTY, OpenSSH, OpenSSL, or any other PKCS#11 compatible software, you should install OpenSC.

0 commit comments

Comments
 (0)