Main push workflow via GitHub Actions.

This commit is contained in:
ᎠᎡ. Ѕϵrgϵ Ѵictor 2020-08-23 11:43:32 +07:00
parent ca8d0d4975
commit 25088b143b
3 changed files with 20 additions and 117 deletions

View File

@ -1,86 +0,0 @@
name: LDP PR Test Builder
on: [pull_request]
env:
LDPHOST: 152.19.134.151
LDPPORT: 122
LDPUSER: builder
jobs:
documents-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🔝 Building System Preparation
run: |
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

View File

@ -3,8 +3,9 @@ name: LDP Master Builder
on: [push]
env:
LDPHOST: 152.19.134.151
LDPPORT: 122
LDPHOST1: 152.19.134.151
LDPHOST2: 152.19.134.152
LDPPORT: 722
LDPUSER: builder
jobs:
@ -21,14 +22,14 @@ jobs:
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
- name: ↪️ Restoring Martin's 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
- name: 🧱 Compiling Martin's LDP Python Scripts if not Found in Cache
if: steps.pythontldp.outputs.cache-hit != 'true'
run: |
cd ~/work
@ -37,7 +38,7 @@ jobs:
python3 setup.py --command-packages=stdeb.command bdist_deb
shell: bash
- name: 🔃 Installation of Martins LDP Python Scripts
- name: 🔃 Installation of Martin's LDP Python Scripts
run: |
cd ~/work
sudo dpkg -i python-tldp/deb_dist/python3-tldp_*_all.deb
@ -46,14 +47,17 @@ jobs:
- 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
mkdir -p /home/runner/.ssh
chmod 700 /home/runner/.ssh
echo "$SSH_KEY" > /home/runner/.ssh/ldpkey
chmod 400 /home/runner/.ssh/ldpkey
ssh-keyscan -p $LDPPORT -H $LDPHOST1 >> /home/runner/.ssh/known_hosts
ssh-keyscan -p $LDPPORT -H $LDPHOST2 >> /home/runner/.ssh/known_hosts
ssh -vv -p $LDPPORT -i /home/runner/.ssh/ldpkey $LDPUSER@$LDPHOST1 ls
ssh -vv -p $LDPPORT -i /home/runner/.ssh/ldpkey $LDPUSER@$LDPHOST2 ls
shell: bash
env:
SSH_KEY: ${{secrets.SSHK}}
SSH_KEY: ${{secrets.SSHKEY}}
- name: ↪️ Restoring Recent Production (Master Branch) LDP Docs from Cache if Available
id: ldpdocsmain
@ -65,7 +69,7 @@ jobs:
- name: 🔀 Restoring Most Current Production (Master Branch) 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/en/ ~/work/MAIN
rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i /home/runner/.ssh/ldpkey" $LDPUSER@$LDPHOST1:/home/builder/en/ ~/work/MAIN
shell: bash
- name: 🧱 LDP Documents Processing via Martins scripts
@ -77,9 +81,10 @@ jobs:
ldptool --loglevel info --builddir BUILD --configfile LDP/LDP/.github/builder.ldptool.cfg --pubdir MAIN --publish
shell: bash
- name: 🔀 Built Documents Transfer for Master Main Documents WWW Server
run:
rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i ~/.ssh/ldpkey" ~/work/MAIN/ $LDPUSER@$LDPHOST:/home/builder/build/en
- name: 🔀 Built Documents Transfer for Master Main Documents WWW Front Servers @ Ibiblio
run: |
rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i /home/runner/.ssh/ldpkey" ~/work/MAIN/ $LDPUSER@$LDPHOST1:/home/builder/en
rsync --stats -rvclz --delete-before -e "ssh -p $LDPPORT -i /home/runner/.ssh/ldpkey" ~/work/MAIN/ $LDPUSER@$LDPHOST2:/home/builder/en
shell: bash
# happy end.

View File

@ -1,16 +0,0 @@
version: v1.0
name: First pipeline
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Test
task:
prologue:
commands:
- checkout
jobs:
- name: 'Job #1'
commands:
- echo A