SSH to Server

  • Example of how to SSH to Server:

jobs:
  ssh:
    name: SSH to Server

    runs-on: [self-hosted, linux]

    env:
      SYSTEM_USER: ${{ secrets.SYSTEM_USER }}

    steps:
    - name: executing remote ssh commands using password
      uses: appleboy/ssh-action@master
      with:
        host: nextcloud.lan
        username: ${{ secrets.SYSTEM_USER_ANSIBLE }}
        key: ${{ secrets.SSH_ANSIBLE_PRIVATE }}
        script: |
          sudo su - $SYSTEM_USER
          cd $HOME
          ls -latr

Last updated