WIP
This commit is contained in:
parent
21c9eb7fa1
commit
98a64a8c29
21
action.yml
21
action.yml
|
@ -59,15 +59,17 @@ runs:
|
||||||
- name: Install SSH config
|
- name: Install SSH config
|
||||||
run: |
|
run: |
|
||||||
echo "Installing SSH config"
|
echo "Installing SSH config"
|
||||||
echo <<EOF > ~/.ssh/config
|
cat <<EOF > ~/.ssh/config
|
||||||
Host targethost
|
Host targethost
|
||||||
User ${{ inputs.username }}
|
User ${{ inputs.username }}
|
||||||
HostName ${{ inputs.host }}
|
HostName ${{ inputs.host }}
|
||||||
Port ${{ inputs.port }}
|
Port ${{ inputs.port }}
|
||||||
|
IdentityFile ~/.ssh/key
|
||||||
ForwardAgent no
|
ForwardAgent no
|
||||||
ForwardX11 no
|
ForwardX11 no
|
||||||
PasswordAuthentication no
|
PasswordAuthentication no
|
||||||
EOF
|
EOF
|
||||||
|
chmod 600 ~/.ssh/config
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install SSH known_hosts
|
- name: Install SSH known_hosts
|
||||||
|
@ -85,17 +87,24 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ inputs.known-host-content == null }}
|
if: ${{ inputs.known-host-content == null }}
|
||||||
|
|
||||||
|
|
||||||
- name: Install SSH key
|
- name: Install SSH key
|
||||||
run: |
|
run: |
|
||||||
echo "Installing SSH key"
|
echo "Installing SSH key"
|
||||||
echo "${{ inputs.ssh-key }}" > ~/.ssh/id_rsa
|
echo "${{ inputs.ssh-key }}" > ~/.ssh/key
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/key
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ inputs.ssh-key != null }}
|
if: ${{ inputs.ssh-key != null }}
|
||||||
|
|
||||||
- name: Transfer files
|
- name: Transfer files
|
||||||
run: |
|
run: |
|
||||||
echo "Transferring files"
|
echo "Transferring files"
|
||||||
rsync ${{ inputs.args }} "${{ inputs.source }}" "targethost:${{ inputs.target }}"
|
ls -lah ~/.ssh
|
||||||
shell: bash
|
cat ~/.ssh/config
|
||||||
|
rsync ${{ inputs.args }} "${{ inputs.source }}" --rsh "ssh -F ~/.ssh/config" "targethost:${{ inputs.target }}"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
# - name: Cleanup
|
||||||
|
# run: |
|
||||||
|
# echo "Cleaning up"
|
||||||
|
# rm -f ~/.ssh/{config,key,known_hosts} || true
|
||||||
|
# shell: bash
|
Loading…
Reference in New Issue