From f27025800258e95afbf0799a55078b6347167ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=8E=A0=E1=8E=A1=2E=20=D0=85=CF=B5rg=CF=B5=20=D1=B4ictor?= Date: Fri, 31 Jan 2020 10:04:15 +0700 Subject: [PATCH] Setting Up Docs Builder via GitHub Actions --- .github/workflows/PR.yml | 83 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 9db84aa4..dd0454b7 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -1,17 +1,86 @@ -name: CI +name: LDP PR Test Builder on: [pull_request] +env: + LDPHOST: 152.19.134.151 + LDPPORT: 122 + LDPUSER: builder + jobs: - build: + documents-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Run a one-line script - run: echo Hello, world! - - name: Run a multi-line script + + - name: 🔝 Building System Preparation run: | - echo Add other actions to build, - echo test, and deploy your project. + sudo apt update + sudo apt -y install texlive-font-utils linuxdoc-tools-text linuxdoc-tools-latex docbook-dsssl docbook-xsl docbook-utils htmldoc htmldoc-common docbook-xsl html2text docbook5-xml docbook-xsl-ns jing asciidoc libxml2-utils python3-stdeb fakeroot python3-all python3-networkx python3-nose fop ldp-docbook-xsl ldp-docbook-dsssl docbook opensp dh-python + shell: bash + + - name: â†Ēī¸ Restoring Martins LDP Python Scripts from Cache + id: pythontldp + uses: actions/cache@v1 + with: + path: ~/work/python-tldp/deb_dist + key: ${{ runner.os }}-pythontldp + + - name: 🧱 Compiling Martins LDP Python Scripts if not Found in Cache + if: steps.pythontldp.outputs.cache-hit != 'true' + run: | + cd ~/work + git clone https://github.com/tLDP/python-tldp + cd python-tldp && rm -rf debian + python3 setup.py --command-packages=stdeb.command bdist_deb + shell: bash + + - name: 🔃 Installation of Martins LDP Python Scripts + run: | + cd ~/work + sudo dpkg -i python-tldp/deb_dist/python3-tldp_*_all.deb + ldptool --dump-cfg + shell: bash + + - name: 🔀 Restoring SSH Key to Manage Documentation Repository + run: | + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo "$SSH_KEY" > ~/.ssh/ldpkey + chmod 400 ~/.ssh/ldpkey + ssh-keyscan -p $LDPPORT -H $LDPHOST >> ~/.ssh/known_hosts + shell: bash + env: + SSH_KEY: ${{secrets.SSHK}} + + - name: â†Ēī¸ Restoring Recent Test LDP Docs from Cache if Available + id: ldpdocstest + uses: actions/cache@v1 + with: + path: ~/work/MAIN + key: ${{ runner.os }}-ldpdocstest + + - name: 🔀 Restoring Most Current Test LDP Docs from LDP WWW Server + run: | + mkdir -p ~/work/MAIN + rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i ~/.ssh/ldpkey" $LDPUSER@$LDPHOST:/home/builder/build/test/en/ ~/work/MAIN + shell: bash + + - name: 🧱 LDP Documents Processing via Martins scripts + run: | + ls -alR ~ + cd ~/work + mkdir -p BUILD + ldptool --loglevel info --builddir BUILD --configfile LDP/LDP/.github/builder.ldptool.cfg --pubdir MAIN --list + ldptool --loglevel info --builddir BUILD --configfile LDP/LDP/.github/builder.ldptool.cfg --pubdir MAIN --publish + shell: bash + + - name: 🔀 Built Documents Transfer for Test Documents WWW Server + run: + rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i ~/.ssh/ldpkey" ~/work/MAIN/ $LDPUSER@$LDPHOST:/home/builder/build/test/en + shell: bash + +# happy end. +# Šī¸ Serge Victor 2020