test
Some checks failed
/ Compilation of content (push) Successful in 11s
/ SSH connection tests (push) Failing after 8s

This commit is contained in:
Yann Kervran 2024-04-19 11:14:44 +02:00
parent c62f041341
commit 55287321e7

View file

@ -1,36 +1,38 @@
on: [push] on: [push]
jobs: jobs:
# test: compilation:
# runs-on: bookworm name: Compilation of content
# container: minidocks/mkdocs runs-on: bookworm
# steps: container: minidocks/mkdocs
# - name: Add NodeJs & Git steps:
# run: | - name: Add NodeJs & Git
# uname -a run: |
# apk add nodejs npm git uname -a
# - name: Checkout repository with git apk add nodejs npm git
# run: | - name: Checkout repository with git
# git clone --depth 1 https://git.numenaute.org/YannK/Actions_tests.git run: |
# # uses: actions/checkout@v4 git clone --depth 1 https://git.numenaute.org/YannK/Actions_tests.git
# # with: # uses: actions/checkout@v4
# # github-server-url: https://git.numenaute.org/ # with:
# - name: Show content # github-server-url: https://git.numenaute.org/
# run: | - name: Show content
# pwd run: |
# ls -al pwd
# - name: Compile mkdocs ls -al
# run: | - name: Compile mkdocs
# cd Actions_tests run: |
# mkdocs build cd Actions_tests
# - name: 'Upload Artifact' mkdocs build
# uses: actions/upload-artifact@v3 - name: 'Upload Artifact'
# with: uses: actions/upload-artifact@v3
# name: Mkdocs_files with:
# path: /workspace/YannK/Actions_tests/Actions_tests/site name: Mkdocs_files
path: /workspace/YannK/Actions_tests/Actions_tests/site
ssh_test: ssh_test:
name: SSH connection tests name: SSH connection tests
runs-on: bookworm runs-on: bookworm
needs: compilation
steps: steps:
- name: Create directory - name: Create directory
run: | run: |
@ -42,7 +44,7 @@ jobs:
run: | run: |
echo "Preparing copy" echo "Preparing copy"
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
- name: Adding knwon hosts - name: Adding known hosts
run: | run: |
ssh-keyscan -p ${{ secrets.SSH_PORT }} -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts ssh-keyscan -p ${{ secrets.SSH_PORT }} -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: Connect and check - 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" ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "ls -al"
- name: Create a file - name: Create a file
run: | run: |
ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "touch CD_TEST.txt" 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