diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 1e9940b..da0603b 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -10,27 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install SSH and dependencies - run: | - apt-get update - apt-get install -y openssh-client - mkdir -p ~/.ssh - chmod 700 ~/.ssh - - name: Write SSH Key run: | - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - # Add known hosts to avoid prompt - ssh-keyscan ${{ vars.SSH_HOST }} >> ~/.ssh/known_hosts - chmod 600 ~/.ssh/known_hosts + echo "$SSH_PRIVATE_KEY" > id_rsa + chmod 600 id_rsa env: SSH_PRIVATE_KEY: ${{ vars.SSH_PRIVATE_KEY }} - - name: Verify SSH connection - run: | - ssh -T -i ~/.ssh/id_rsa ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} echo "SSH connection successful" - - name: Run SSH Deploy Script run: | - ssh -i ~/.ssh/id_rsa ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} "cd /root/timelapse-backend && ./deploy.sh" \ No newline at end of file + ssh -i id_rsa -o StrictHostKeyChecking=no ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} "cd /root/timelapse-backend && ./deploy.sh"