File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 1- name : Test on macOS M1
1+ name : Interactive SSH Access
22
33on :
4- push :
5- pull_request :
64 workflow_dispatch :
75
8-
96jobs :
107 setup-ssh :
118 runs-on : macos-12
@@ -30,19 +27,20 @@ jobs:
3027 run : sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
3128
3229 - name : Generate SSH key
33- run : |
34- ssh-keygen -t rsa -b 4096 -f ./id_rsa -N ""
35- cat ./id_rsa.pub >> ~/.ssh/authorized_keys
3630 id : ssh-key
31+ run : |
32+ ssh-keygen -t rsa -b 4096 -f $HOME/.ssh/id_rsa -N ""
33+ cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
34+ echo "Private key for SSH access:"
35+ cat $HOME/.ssh/id_rsa
3736
3837 - name : Display SSH connection info
3938 run : |
40- echo "Connect with the following command:"
41- echo "ssh -i ./id_rsa $(whoami)@$(hostname)"
42- env :
43- SSH_KEY : ${{ steps.ssh-key.outputs.ssh-key }}
39+ echo "Use the following command to connect to the runner via SSH:"
40+ echo "ssh -i $HOME/.ssh/id_rsa $(whoami)@$(hostname)"
4441
4542 - name : Keep runner alive for 30 minutes
4643 run : |
4744 echo "Runner will stay alive for 30 minutes. Connect using SSH."
4845 sleep 1800
46+
You can’t perform that action at this time.
0 commit comments