nightly-full-build #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nightly-full-build | |
on: | |
schedule: | |
- cron: '15 4 * * *' | |
jobs: | |
nightly-complete-build: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
container: | |
image: python:3.11 | |
#options: --user 1001 (only if we don't need apt-get) | |
env: | |
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@v4 | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
with: | |
repository: nitrokey/nitrokey-documentation | |
path: source.git | |
- name: Install additional python packages | |
run: | | |
make -C source.git venv | |
ln -s source.git/venv venv | |
- name: WORKAROUND - revert replace double backslashes in .po files | |
shell: bash | |
run: | | |
sed -ie 's@/bs/@\\\\@g' $(find locales -name "*.po" | xargs) | |
- name: Build full docs (all languages) | |
run: | | |
cp -r locales source.git/source/locales | |
mkdir -p dist | |
cp source.git/redirects/.htaccess dist | |
for lang in $MAIN_LANGS $OTHER_LANGS | |
do | |
mkdir -p dist/$lang | |
mkdir -p build/$lang/doctrees | |
venv/bin/sphinx-build -j auto -b html -D language=$lang -d build/$lang/doctrees source.git/source dist/$lang | |
done | |
- name: Cleanup before packing, pack only one _images | |
shell: bash | |
run: | | |
mv dist/en/_images dist | |
for lang in $MAIN_LANGS $OTHER_LANGS | |
do | |
rm -rf dist/$lang/_sources dist/$lang/_images | |
done | |
- name: Upload full build artifact | |
id: upload-full | |
uses: actions/upload-artifact@v4 | |
with: | |
name: generated documentation (all) | |
path: dist | |
include-hidden-files: true | |
- name: Trigger docs server to download and deploy full documentation | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DOCS_HOST }} | |
username: docs | |
port: ${{ secrets.DOCS_PORT }} | |
key: ${{ secrets.DEPLOY_AUTH_KEY }} | |
script: /var/www/docs/deploy/gh-trigger.sh all ${{ steps.upload-full.outputs.artifact-id }} ${{ secrets.DOWNLOAD_TOKEN }} | |