docs: update readme

This commit is contained in:
Bo-Yi Wu 2019-05-11 19:49:38 +08:00
parent c73f1d85aa
commit 64c8a87402

View File

@ -25,15 +25,26 @@ action "Copy multiple file" {
} }
``` ```
## Environment variables
* HOST - ssh server host
* PORT - ssh server port
* USERNAME - ssh server username
* PASSWORD - ssh server password
* KEY - ssh server private key
* TARGET - target folder
* SOURCE - scp file list
### Example ### Example
Copy file via ssh password
``` ```
action "Copy multiple file" { action "Copy multiple file" {
uses = "appleboy/scp-action@master" uses = "appleboy/scp-action@master"
env = { env = {
HOST = "example.com" HOST = "example.com"
USERNAME = "foo" USERNAME = "foo"
PASSWORD = "bar"
PORT = "22" PORT = "22"
SOURCE = "tests/a.txt,tests/b.txt" SOURCE = "tests/a.txt,tests/b.txt"
TARGET = "/home/foo/test" TARGET = "/home/foo/test"
@ -43,3 +54,44 @@ action "Copy multiple file" {
] ]
} }
``` ```
Copy file via ssh key
```
action "Copy file via ssh key" {
uses = "appleboy/scp-action@master"
env = {
HOST = "example.com"
USERNAME = "foo"
PORT = "22"
SOURCE = "tests/c.txt,tests/d.txt"
TARGET = "/home/actions/test"
}
secrets = [
"KEY",
]
}
```
Example configuration for ignore list:
```
action "reqular expression list" {
uses = "appleboy/scp-action@master"
env = {
HOST = "example.com"
USERNAME = "foo"
PORT = "22"
SOURCE = "tests/*.txt,!tests/a.txt"
TARGET = "/home/actions/test"
}
secrets = [
"KEY",
]
}
```
## Secrets
* `PASSWORD` - ssh server password
* `KEY` - ssh server private key