Skip to content

Commit dcab73c

Browse files
committed
ci: add nightly full build; commit-triggered: only translate
1 parent 82e90ba commit dcab73c

File tree

2 files changed

+124
-40
lines changed

2 files changed

+124
-40
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ jobs:
4343
- name: Weblate - pull component repository
4444
run: bash trigger_weblate.sh ${{ secrets.WEBLATE_API_URL }} none ${{ secrets.WEBLATE_TOKEN }} pull
4545

46-
- name: Checkout Sources
47-
uses: actions/checkout@v4
48-
with:
49-
repository: nitrokey/nitrokey-documentation
50-
path: source.git
46+
- name: Weblate - force wait hoping for weblate to settle
47+
run: sleep 120
48+
49+
# - name: Checkout Sources
50+
# uses: actions/checkout@v4
51+
# with:
52+
# repository: nitrokey/nitrokey-documentation
53+
# path: source.git
5154

5255
- name: Weblate - trigger automated translations
5356
shell: bash
@@ -60,46 +63,46 @@ jobs:
6063
- name: Weblate - push to upstream
6164
run: bash trigger_weblate.sh ${{ secrets.WEBLATE_API_URL }} none ${{ secrets.WEBLATE_TOKEN }} push
6265

63-
- name: WORKAROUND - revert replace double backslashes in .po files
64-
shell: bash
65-
run: |
66-
sed -ie 's@/bs/@\\\\@g' $(find locales -name "*.po" | xargs)
66+
# - name: WORKAROUND - revert replace double backslashes in .po files
67+
# shell: bash
68+
# run: |
69+
# sed -ie 's@/bs/@\\\\@g' $(find locales -name "*.po" | xargs)
6770

68-
- name: Build full docs (all languages)
69-
run: |
70-
cp -r locales source.git/source/locales
71-
for lang in $MAIN_LANGS $OTHER_LANGS
72-
do
73-
mkdir -p dist/$lang
74-
mkdir -p build/$lang/doctrees
75-
sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source.git/source dist/$lang
76-
done
71+
# - name: Build full docs (all languages)
72+
# run: |
73+
# cp -r locales source.git/source/locales
74+
# for lang in $MAIN_LANGS $OTHER_LANGS
75+
# do
76+
# mkdir -p dist/$lang
77+
# mkdir -p build/$lang/doctrees
78+
# sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source.git/source dist/$lang
79+
# done
7780

78-
- name: Cleanup before packing, pack only one _images
79-
shell: bash
80-
run: |
81-
mv dist/en/_images dist
81+
# - name: Cleanup before packing, pack only one _images
82+
# shell: bash
83+
# run: |
84+
# mv dist/en/_images dist
8285

83-
for lang in $MAIN_LANGS $OTHER_LANGS
84-
do
85-
rm -rf dist/$lang/_sources dist/$lang/_images
86-
done
86+
# for lang in $MAIN_LANGS $OTHER_LANGS
87+
# do
88+
# rm -rf dist/$lang/_sources dist/$lang/_images
89+
# done
8790

88-
- name: Upload full build artifact
89-
id: upload-full
90-
uses: actions/upload-artifact@v4
91-
with:
92-
name: generated documentation (all)
93-
path: dist
91+
# - name: Upload full build artifact
92+
# id: upload-full
93+
# uses: actions/upload-artifact@v4
94+
# with:
95+
# name: generated documentation (all)
96+
# path: dist
9497

95-
- name: Trigger docs server to download and deploy full documentation
96-
uses: appleboy/[email protected]
97-
with:
98-
host: ${{ secrets.DOCS_HOST }}
99-
username: docs
100-
port: ${{ secrets.DOCS_PORT }}
101-
key: ${{ secrets.DEPLOY_AUTH_KEY }}
102-
script: /var/www/docs/deploy/github-trigger.sh all ${{ steps.upload-full.outputs.artifact-id }} ${{ secrets.DOWNLOAD_TOKEN }}
98+
# - name: Trigger docs server to download and deploy full documentation
99+
# uses: appleboy/[email protected]
100+
# with:
101+
# host: ${{ secrets.DOCS_HOST }}
102+
# username: docs
103+
# port: ${{ secrets.DOCS_PORT }}
104+
# key: ${{ secrets.DEPLOY_AUTH_KEY }}
105+
# script: /var/www/docs/deploy/github-trigger.sh all ${{ steps.upload-full.outputs.artifact-id }} ${{ secrets.DOWNLOAD_TOKEN }}
103106

104107

105108

.github/workflows/scheduled.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: nightly-full-build
2+
on:
3+
schedule:
4+
- cron: '15 4 * * *'
5+
6+
jobs:
7+
nightly-complete-build:
8+
concurrency:
9+
group: ${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
runs-on: ubuntu-latest
13+
container:
14+
image: sphinxdoc/sphinx
15+
#options: --user 1001 (only if we don't need apt-get)
16+
17+
env:
18+
MAIN_LANGS: en
19+
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
20+
21+
steps:
22+
- name: Install git
23+
run: |
24+
apt-get -y update
25+
apt-get -y install git ssh curl
26+
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Install additional python packages
31+
run: pip3 install -r requirements.txt
32+
33+
- name: Checkout Sources
34+
uses: actions/checkout@v4
35+
with:
36+
repository: nitrokey/nitrokey-documentation
37+
path: source.git
38+
39+
- name: WORKAROUND - revert replace double backslashes in .po files
40+
shell: bash
41+
run: |
42+
sed -ie 's@/bs/@\\\\@g' $(find locales -name "*.po" | xargs)
43+
44+
- name: Build full docs (all languages)
45+
run: |
46+
cp -r locales source.git/source/locales
47+
for lang in $MAIN_LANGS $OTHER_LANGS
48+
do
49+
mkdir -p dist/$lang
50+
mkdir -p build/$lang/doctrees
51+
sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source.git/source dist/$lang
52+
done
53+
54+
- name: Cleanup before packing, pack only one _images
55+
shell: bash
56+
run: |
57+
mv dist/en/_images dist
58+
59+
for lang in $MAIN_LANGS $OTHER_LANGS
60+
do
61+
rm -rf dist/$lang/_sources dist/$lang/_images
62+
done
63+
64+
- name: Upload full build artifact
65+
id: upload-full
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: generated documentation (all)
69+
path: dist
70+
71+
- name: Trigger docs server to download and deploy full documentation
72+
uses: appleboy/[email protected]
73+
with:
74+
host: ${{ secrets.DOCS_HOST }}
75+
username: docs
76+
port: ${{ secrets.DOCS_PORT }}
77+
key: ${{ secrets.DEPLOY_AUTH_KEY }}
78+
script: /var/www/docs/deploy/github-trigger.sh all ${{ steps.upload-full.outputs.artifact-id }} ${{ secrets.DOWNLOAD_TOKEN }}
79+
80+
81+

0 commit comments

Comments
 (0)