diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 67a6d35..5dfa3ca 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -34,6 +34,7 @@ jobs: uses: cross-the-world/scp-pipeline@master with: host: ${{ secrets.DC_HOST }} + port: ${{ secrets.DC_PORT }} user: ${{ secrets.DC_USER }} pass: ${{ secrets.DC_PASS }} local: "./test/test1*" @@ -45,7 +46,20 @@ jobs: TO_DIR: /home/github/test/test3/ with: host: ${{ secrets.DC_HOST }} + port: ${{ secrets.DC_PORT }} user: ${{ secrets.DC_USER }} pass: ${{ secrets.DC_PASS }} local: "." remote: $TO_DIR + + - name: local remote scp 3 + uses: cross-the-world/scp-pipeline@master + env: + TO_DIR: /home/github/test/test3/ + with: + host: ${{ secrets.DC_HOST }} + port: ${{ secrets.DC_PORT }} + user: ${{ secrets.DC_USER }} + key: ${{ secrets.DC_KEY }} + local: "." + remote: $TO_DIR \ No newline at end of file diff --git a/app.py b/app.py index 77b6e98..82dc259 100644 --- a/app.py +++ b/app.py @@ -6,6 +6,7 @@ import scp import sys import math import re +import tempfile envs = environ @@ -47,7 +48,11 @@ def strip_and_parse_envs(p): def connect(): ssh = paramiko.SSHClient() - p_key = paramiko.RSAKey.from_private_key(INPUT_KEY) if INPUT_KEY else None + p_key = None + if INPUT_KEY: + with tempfile.TemporaryFile() as fp: + fp.write(INPUT_KEY.encode()) + p_key = paramiko.RSAKey.from_private_key(INPUT_KEY) ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(INPUT_HOST, port=INPUT_PORT, username=INPUT_USER, pkey=p_key, password=INPUT_PASS,