From f8e9ba59be300afcc2493c1df7178d656d434191 Mon Sep 17 00:00:00 2001 From: Chengming-Li <115936688+Chengming-Li@users.noreply.github.com> Date: Thu, 4 Apr 2024 19:46:09 -0700 Subject: [PATCH] Update cd-branch.yml --- .github/workflows/cd-branch.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd-branch.yml b/.github/workflows/cd-branch.yml index 98da25bdb..701f0d690 100644 --- a/.github/workflows/cd-branch.yml +++ b/.github/workflows/cd-branch.yml @@ -14,10 +14,12 @@ jobs: options: --privileged steps: - - name: Install SSH client + - name: SSH into server + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }} run: | - apt-get update - apt-get install -y openssh-client - - name: Run SSH command - run: | - ssh -i ${{ secrets.SSH_KEY }} root@hozer-51.ocf.berkeley.edu "echo test" + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + + ssh -o StrictHostKeyChecking=no -p root@hozer-51.ocf.berkeley.edu "echo 'SSH connection established!'"