chore: copy file via ssh password

This commit is contained in:
Bo-Yi Wu 2019-09-28 10:54:49 +08:00
parent a6224ab4f0
commit b154adaf5c
2 changed files with 17 additions and 75 deletions

View file

@ -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"

View file

@ -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 <appleboy.tw@gmail.com>"
LABEL "version"="0.0.1"
FROM appleboy/drone-scp
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh