From a79592f0dae5a6d3ed7b1d38c5115c51b33f1f33 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 15 May 2019 06:32:43 +0800 Subject: [PATCH] Add example Signed-off-by: Bo-Yi Wu --- .github/main.workflow | 18 ++++++++++++++++++ README.md | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .github/main.workflow diff --git a/.github/main.workflow b/.github/main.workflow new file mode 100644 index 0000000..655fdee --- /dev/null +++ b/.github/main.workflow @@ -0,0 +1,18 @@ +workflow "Copy File Via SSH" { + on = "push" + resolves = [ + "Executing remote ssh commands", + ] +} + +action "Executing remote ssh commands" { + uses = "appleboy/ssh-action@master" + secrets = [ + "HOST", + "USERNAME", + "PASSWORD", + ] + args = [ + "--script", "whoami", + ] +} diff --git a/README.md b/README.md index 3e1deaa..f1c2531 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ -# ssh-action +# 🚀 SSH for GitHub Actions -GitHub Action for executing remote ssh commands. +[GitHub Action](https://developer.github.com/actions/) for executing remote ssh commands. + +## Usage + +copy files and artifacts via SSH as blow. + +``` +action "Copy multiple file" { + uses = "appleboy/scp-action@master" + env = { + HOST = "example.com" + USERNAME = "foo" + PASSWORD = "bar" + PORT = "22" + SOURCE = "tests/a.txt,tests/b.txt" + TARGET = "/home/foo/test" + } + secrets = [ + "PASSWORD", + ] +} +``` + +## Environment variables + +* HOST - ssh server host +* PORT - ssh server port +* USERNAME - ssh server username +* PASSWORD - ssh server password +* KEY - ssh server private key +* SCRIPT - execute the scripts