Use this action to connect to a remote server and execute commands via the Secure Shell Protocol (SSH).
Input name | Data type | Required? | Description |
---|---|---|---|
|
String |
Yes |
SSH host address. |
|
String |
Yes |
The SSH username. |
|
String |
No |
SSH port number. Default is |
|
String |
Yes |
The commands to be executed. |
|
String |
Required only if |
The path to the SSH private key file. |
|
String |
No |
The SSH key passphrase. |
|
String |
Required only if |
The SSH password. |
In your YAML file, add:
- name: SSH with username and key
uses: cloudbees-io/ssh-deploy-actions@v1
with:
host: ${{ secrets.SSH_HOST }}
username: user1
key_path: ${{ secrets.SSH_PRIVATE_KEY }}
port: "22"
script: whoami,pwd,echo "hello"
In your YAML file, add:
- name: SSH with username and password
uses: cloudbees-io/ssh-deploy-actions@v1
with:
host: ${{ secrets.SSH_HOST }}
username: testUser
password: ${{ secrets.SSH_PASSWORD }}
port: "22"
script: whoami,pwd
In your YAML file, add:
- name: SSH with username and passphrase-protected key
uses: cloudbees-io/ssh-deploy-actions@v1
with:
host: ${{ secrets.SSH_HOST }}
username: demoUser
key_path: ${{ secrets.SSH_PP_KEY }}
port: "22"
passphrase: ${{ secrets.SSH_PP_KEY_PASSPHRASE }}
script: pwd,echo "hello"
This code is made available under the MIT license.
-
Learn more about using actions in CloudBees workflows.
-
Learn about the CloudBees platform.