fix: use dynamic host IP for SSH in CI
Some checks failed
Deploy Canina / deploy (push) Failing after 3s
Some checks failed
Deploy Canina / deploy (push) Failing after 3s
This commit is contained in:
parent
24000f60dd
commit
1396ad3bd8
@ -14,9 +14,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SSH_KEY: ${{ secrets.DEPLOY_KEY }}
|
SSH_KEY: ${{ secrets.DEPLOY_KEY }}
|
||||||
run: |
|
run: |
|
||||||
|
HOST_IP=$(ip route | grep default | cut -d' ' -f3)
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "$SSH_KEY" > ~/.ssh/id_ed25519
|
echo "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
ssh-keyscan -p 2234 -H 172.17.0.1 >> ~/.ssh/known_hosts
|
ssh-keyscan -p 2234 -H "$HOST_IP" >> ~/.ssh/known_hosts
|
||||||
|
echo "Host IP: $HOST_IP"
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: ssh -p 2234 devops@172.17.0.1 'bash /opt/services/scripts/depcanina.sh main'
|
run: |
|
||||||
|
HOST_IP=$(ip route | grep default | cut -d' ' -f3)
|
||||||
|
ssh -p 2234 devops@$HOST_IP 'bash /opt/services/scripts/depcanina.sh main'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user