name: Setup SSH description: Configures the deploy server as the SSH host "deploy" for ssh and scp inputs: host: description: Deploy server host name required: true user: description: Deploy server user required: true port: description: Deploy server SSH port required: false default: '22' key: description: Private SSH key of the deploy user required: true runs: using: composite steps: - name: Configure SSH shell: bash env: DEPLOY_HOST: ${{ inputs.host }} DEPLOY_USER: ${{ inputs.user }} DEPLOY_PORT: ${{ inputs.port }} DEPLOY_SSH_KEY: ${{ inputs.key }} run: | set -euo pipefail : "${DEPLOY_HOST:?Missing DEPLOY_HOST secret}" : "${DEPLOY_USER:?Missing DEPLOY_USER secret}" : "${DEPLOY_SSH_KEY:?Missing DEPLOY_SSH_KEY secret}" port="${DEPLOY_PORT:-22}" mkdir -p ~/.ssh chmod 700 ~/.ssh echo "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key chmod 600 ~/.ssh/deploy_key ssh-keyscan -p "$port" "$DEPLOY_HOST" >> ~/.ssh/known_hosts cat >> ~/.ssh/config <