This action could connect your self-server and execute commands and script on it via SSH.
PRIVATE_KEY
, IP
, PORT
and USERNAME
corresponding to the PRIVATE_KEY.The SHELL parameter in with is the command that needs to be executed on your own server.
steps:
- uses: actions/checkout@v2
- uses: tzzs/server-ssh@main
with:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY}}
USERNAME: ${{secrets.USERNAME}}
IP: ${{secrets.IP}}
PORT: ${{secrets.PORT}}
SHELL: |
"echo action-test"
"ls"
Add the following parameters to secrets:
PRIVATE_KEY
, IP
,SHELL(optional default:22)
,USERNAME
The following parameters (some optional) need to be configured in workflow.
PRIVATE_KEY
[required]
This is from the ~/.ssh/id_rsa
file.
IP
[required]
eg: 127.0.0.1
PORT
[optional, default: 22]
eg: 22
USERNAME
[required]
eg: root
SHELL
(optional), use the |
symbol to add multiple commands
SHELL: |
"echo action-test"
"ls"
The result of each command is printed in the action console.
Protect your private key and use at your own risk.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。