2019-05-11 17:03:14 +08:00
|
|
|
workflow "Copy File Via SSH" {
|
2019-05-11 17:01:31 +08:00
|
|
|
on = "push"
|
|
|
|
resolves = [
|
2019-05-11 19:28:30 +08:00
|
|
|
"Copy file via ssh password",
|
|
|
|
"Copy file via ssh key",
|
2019-05-11 21:16:16 +08:00
|
|
|
"Add source in args",
|
|
|
|
"Add secret in args",
|
2019-05-11 17:01:31 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-05-11 19:28:30 +08:00
|
|
|
action "Copy file via ssh password" {
|
2019-05-11 17:01:31 +08:00
|
|
|
uses = "appleboy/scp-action@master"
|
|
|
|
env = {
|
|
|
|
SOURCE = "tests/a.txt,tests/b.txt"
|
|
|
|
TARGET = "/home/actions/test"
|
|
|
|
}
|
|
|
|
secrets = [
|
|
|
|
"HOST",
|
|
|
|
"USERNAME",
|
|
|
|
"PASSWORD",
|
|
|
|
]
|
|
|
|
}
|
2019-05-11 19:28:30 +08:00
|
|
|
|
|
|
|
action "Copy file via ssh key" {
|
|
|
|
uses = "appleboy/scp-action@master"
|
|
|
|
env = {
|
|
|
|
SOURCE = "tests/a.txt,tests/b.txt"
|
|
|
|
TARGET = "/home/actions/test"
|
|
|
|
}
|
|
|
|
secrets = [
|
|
|
|
"HOST",
|
|
|
|
"USERNAME",
|
|
|
|
"KEY",
|
|
|
|
]
|
|
|
|
}
|
2019-05-11 20:34:40 +08:00
|
|
|
|
2019-05-11 21:16:16 +08:00
|
|
|
action "Add source in args" {
|
2019-05-11 20:34:40 +08:00
|
|
|
uses = "appleboy/scp-action@master"
|
|
|
|
env = {
|
|
|
|
TARGET = "/home/actions/test1234"
|
|
|
|
}
|
|
|
|
secrets = [
|
|
|
|
"HOST",
|
|
|
|
"USERNAME",
|
|
|
|
"KEY",
|
|
|
|
]
|
|
|
|
args = ["--source", "tests/a.txt", "--source", "tests/b.txt"]
|
|
|
|
}
|
2019-05-11 21:16:16 +08:00
|
|
|
|
|
|
|
action "Add secret in args" {
|
|
|
|
uses = "appleboy/scp-action@master"
|
|
|
|
env = {
|
|
|
|
TARGET = "/home/actions/test1234"
|
|
|
|
}
|
|
|
|
secrets = [
|
|
|
|
"HOST",
|
|
|
|
"KEY",
|
|
|
|
]
|
2019-05-11 21:31:19 +08:00
|
|
|
args = [
|
|
|
|
"--username", "$USERNAME",
|
|
|
|
"--source", "tests/a.txt",
|
|
|
|
"--source", "tests/b.txt",
|
|
|
|
]
|
2019-05-11 21:16:16 +08:00
|
|
|
}
|