mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-08-31 22:15:45 -06:00
Update test.yml
This commit is contained in:
parent
d9e30df17d
commit
029e36f26a
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -26,19 +26,13 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup remote
|
||||
run: |
|
||||
echo "$SSH_PUBLIC_KEY" | sudo tee /etc/ssh/authorized_keys
|
||||
sudo chmod 600 /etc/ssh/authorized_keys
|
||||
sudo tee /etc/ssh/sshd_config <<EOF
|
||||
PasswordAuthentication no
|
||||
PubkeyAuthentication yes
|
||||
AuthorizedKeysFile /etc/ssh/authorized_keys
|
||||
PermitRootLogin no
|
||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
EOF
|
||||
sudo systemctl restart ssh
|
||||
mkdir -p "$HOME/.ssh"
|
||||
echo "$SSH_PUBLIC_KEY" | tee "$HOME/.ssh/authorized_keys"
|
||||
chmod 600 "$HOME/.ssh/authorized_keys"
|
||||
echo 'SSH_KNOWN_HOSTS<<EOF' >> $GITHUB_ENV
|
||||
echo $(ssh-keyscan localhost) >> $GITHUB_ENV
|
||||
echo 'EOF' >> $GITHUB_ENV
|
||||
ssh -i <(echo "$SSH_PRIVATE_KEY") localhost whoami
|
||||
- name: With everything
|
||||
uses: ./
|
||||
with:
|
||||
|
Loading…
x
Reference in New Issue
Block a user