Skip to content

Commit a79592f

Browse files
committed
Add example
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent 5e4c286 commit a79592f

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

.github/main.workflow

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
workflow "Copy File Via SSH" {
2+
on = "push"
3+
resolves = [
4+
"Executing remote ssh commands",
5+
]
6+
}
7+
8+
action "Executing remote ssh commands" {
9+
uses = "appleboy/ssh-action@master"
10+
secrets = [
11+
"HOST",
12+
"USERNAME",
13+
"PASSWORD",
14+
]
15+
args = [
16+
"--script", "whoami",
17+
]
18+
}

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1-
# ssh-action
1+
# 🚀 SSH for GitHub Actions
22

3-
GitHub Action for executing remote ssh commands.
3+
[GitHub Action](https://developer.github.com/actions/) for executing remote ssh commands.
4+
5+
## Usage
6+
7+
copy files and artifacts via SSH as blow.
8+
9+
```
10+
action "Copy multiple file" {
11+
uses = "appleboy/scp-action@master"
12+
env = {
13+
HOST = "example.com"
14+
USERNAME = "foo"
15+
PASSWORD = "bar"
16+
PORT = "22"
17+
SOURCE = "tests/a.txt,tests/b.txt"
18+
TARGET = "/home/foo/test"
19+
}
20+
secrets = [
21+
"PASSWORD",
22+
]
23+
}
24+
```
25+
26+
## Environment variables
27+
28+
* HOST - ssh server host
29+
* PORT - ssh server port
30+
* USERNAME - ssh server username
31+
* PASSWORD - ssh server password
32+
* KEY - ssh server private key
33+
* SCRIPT - execute the scripts

0 commit comments

Comments
 (0)