From c73f1d85aa0cb04f0d8685ac4dc21e57169479aa Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 11 May 2019 19:28:30 +0800 Subject: [PATCH] feat: Copy file via ssh key --- .github/main.workflow | 18 ++++++++++++++++-- tests/c.txt | 1 + tests/d.txt | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/c.txt create mode 100644 tests/d.txt diff --git a/.github/main.workflow b/.github/main.workflow index 68d8059..00640eb 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,11 +1,12 @@ workflow "Copy File Via SSH" { on = "push" resolves = [ - "Copy multiple file", + "Copy file via ssh password", + "Copy file via ssh key", ] } -action "Copy multiple file" { +action "Copy file via ssh password" { uses = "appleboy/scp-action@master" env = { SOURCE = "tests/a.txt,tests/b.txt" @@ -17,3 +18,16 @@ action "Copy multiple file" { "PASSWORD", ] } + +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", + ] +} diff --git a/tests/c.txt b/tests/c.txt new file mode 100644 index 0000000..f2ad6c7 --- /dev/null +++ b/tests/c.txt @@ -0,0 +1 @@ +c diff --git a/tests/d.txt b/tests/d.txt new file mode 100644 index 0000000..4bcfe98 --- /dev/null +++ b/tests/d.txt @@ -0,0 +1 @@ +d