This commit is contained in:
Yann Kervran 2024-04-19 10:28:19 +02:00
parent 2955d2aded
commit 66a0c1cd77

View file

@ -29,8 +29,14 @@ jobs:
# path: /workspace/YannK/Actions_tests/Actions_tests/site
secret_test:
name: SSH connection tests
runs-on: bookworm
steps:
- name: Test de secret
- name: Install SSH key to proper place
run: |
echo {{ secrets.CD_SECRET_NUMBER_1 }}
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: Connect and check
run: |
ssh -i ~/.ssh/id_rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "ls -al"