ci: use SSH key mounted directly in runner container instead of secret
This commit is contained in:
1 parent
12e1267a51
commit
790f0b9410
1 file changed
+4
-6
@@ -54,13 +54,11 @@ jobs:
|
||||
run: |
|
||||
apk add --no-cache openssh-client
|
||||
|
||||
# Installer la clé privée SSH
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -H 192.168.1.39 >> ~/.ssh/known_hosts
|
||||
# Clé montée directement dans le runner via volume Docker
|
||||
chmod 600 /root/.ssh/id_ed25519
|
||||
ssh-keyscan -H 192.168.1.39 >> /root/.ssh/known_hosts
|
||||
|
||||
SSH="ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no Stude12@192.168.1.39"
|
||||
SSH="ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=no Stude12@192.168.1.39"
|
||||
|
||||
# Copier docker-compose.prod.yml sur le NAS
|
||||
cat docker-compose.prod.yml | $SSH \
|
||||
|
||||
Reference in new issue
Block a user