You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Server Shell
v1
This action could connect your self-server and execute command on it via SSH. This is useful when you want to execute commands on your own server form your workflow.
- This action requires your own server SSH
PRIVATE_KEY
,IP
andUSERNAME
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
- run: npm install
shell: bash
- uses: ./
with:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY}}
USERNAME: ${{secrets.USERNAME}}
IP: ${{secrets.IP}}
SHELL: |
"echo action-test"
"ls"
Add the following parameters to secrets:
PRIVATE_KEY
IP
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
USERNAME
[required]
eg: root
SHELL
(optional), use the|
symbol to add multiple commands
SHELL: |
"echo action-test"
"ls"
The result of each command are printed in the action console.
Protect your private key and use at your own risk.