From 55287321e7447eeeaf4756f48da2c12ca67eb931 Mon Sep 17 00:00:00 2001 From: Yann Kervran Date: Fri, 19 Apr 2024 11:14:44 +0200 Subject: [PATCH] test --- .forgejo/workflows/test.yaml | 67 ++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml index 41a283e..c683aac 100644 --- a/.forgejo/workflows/test.yaml +++ b/.forgejo/workflows/test.yaml @@ -1,36 +1,38 @@ on: [push] jobs: -# test: -# runs-on: bookworm -# container: minidocks/mkdocs -# steps: -# - name: Add NodeJs & Git -# run: | -# uname -a -# apk add nodejs npm git -# - name: Checkout repository with git -# run: | -# git clone --depth 1 https://git.numenaute.org/YannK/Actions_tests.git -# # uses: actions/checkout@v4 -# # with: -# # github-server-url: https://git.numenaute.org/ -# - name: Show content -# run: | -# pwd -# ls -al -# - name: Compile mkdocs -# run: | -# cd Actions_tests -# mkdocs build -# - name: 'Upload Artifact' -# uses: actions/upload-artifact@v3 -# with: -# name: Mkdocs_files -# path: /workspace/YannK/Actions_tests/Actions_tests/site + compilation: + name: Compilation of content + runs-on: bookworm + container: minidocks/mkdocs + steps: + - name: Add NodeJs & Git + run: | + uname -a + apk add nodejs npm git + - name: Checkout repository with git + run: | + git clone --depth 1 https://git.numenaute.org/YannK/Actions_tests.git + # uses: actions/checkout@v4 + # with: + # github-server-url: https://git.numenaute.org/ + - name: Show content + run: | + pwd + ls -al + - name: Compile mkdocs + run: | + cd Actions_tests + mkdocs build + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: Mkdocs_files + path: /workspace/YannK/Actions_tests/Actions_tests/site ssh_test: name: SSH connection tests runs-on: bookworm + needs: compilation steps: - name: Create directory run: | @@ -42,7 +44,7 @@ jobs: run: | echo "Preparing copy" echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa - - name: Adding knwon hosts + - name: Adding known hosts run: | ssh-keyscan -p ${{ secrets.SSH_PORT }} -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts - name: Connect and check @@ -50,4 +52,11 @@ jobs: ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "ls -al" - name: Create a file run: | - ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "touch CD_TEST.txt" \ No newline at end of file + ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "touch CD_TEST.txt" + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: Mkdocs_files + - name: Send the Mkdocs_files + run: | + rsync -avPz -e 'ssh -p ${{ secrets.SSH_PORT }}' . ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:www \ No newline at end of file