From b154adaf5cff3c4e4ba52533cea43f5203f38442 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 28 Sep 2019 10:54:49 +0800 Subject: [PATCH] chore: copy file via ssh password --- .github/workflows/ci.yml | 79 ++++++++-------------------------------- Dockerfile | 13 +------ 2 files changed, 17 insertions(+), 75 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c07556..3355bbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,65 +1,18 @@ -workflow "Copy File Via SSH" { - on = "push" - resolves = [ - "Copy file via ssh password", - "Copy file via ssh key", - "Add source in args", - "Add secret in args", - ] -} +name: scp files +on: [push] +jobs: -action "Copy file via ssh password" { - uses = "appleboy/scp-action@master" - env = { - SOURCE = "tests/a.txt,tests/b.txt" - TARGET = "/home/actions/test" - } - secrets = [ - "HOST", - "USERNAME", - "PASSWORD", - ] -} + build: + name: Build + runs-on: ubuntu-latest + steps: -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", - ] -} - -action "Add source in args" { - uses = "appleboy/scp-action@master" - env = { - TARGET = "/home/actions/test1234" - } - secrets = [ - "HOST", - "USERNAME", - "KEY", - ] - args = ["--source", "tests/a.txt", "--source", "tests/b.txt"] -} - -action "Add secret in args" { - uses = "appleboy/scp-action@master" - env = { - TARGET = "/home/actions/test1234" - } - secrets = [ - "HOST", - "TEST_USERNAME", - "KEY", - ] - args = [ - "--username", "$TEST_USERNAME", - "--source", "tests/a.txt", - "--source", "tests/b.txt", - ] -} + - name: copy file via ssh password + uses: appleboy/scp-action@master + env: + HOST: ${{ secrets.HOST }} + USERNAME: ${{ secrets.USERNAME }} + PASSWORD: ${{ secrets.PASSWORD }} + with: + source: "tests/a.txt,tests/b.txt" + target: "/home/actions/test" diff --git a/Dockerfile b/Dockerfile index f3cc73c..2fe1041 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,4 @@ -FROM appleboy/drone-scp:1.5.1-linux-amd64 - -# Github labels -LABEL "com.github.actions.name"="SCP Files" -LABEL "com.github.actions.description"="Copy files and artifacts via SSH" -LABEL "com.github.actions.icon"="copy" -LABEL "com.github.actions.color"="gray-dark" - -LABEL "repository"="https://github.com/appleboy/scp-action" -LABEL "homepage"="https://github.com/appleboy" -LABEL "maintainer"="Bo-Yi Wu " -LABEL "version"="0.0.1" +FROM appleboy/drone-scp ADD entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh