|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 blackantt 于 2023-2-26 13:27 编辑
参考
https://github.com/marketplace/actions/copy-via-ssh
Copy a single file to a remote server
- name: Copy single file to remote
uses: garygrossgarten/github-action-scp@release
with:
local: test/oof.txt
remote: scp/single/oof.txt
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
参考
https://github.com/nicklasfrahm/scp-action
Uploading local files to remote target
name: upload
on:
- push
jobs:
upload:
name: Upload
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@master
- name: Upload file via SSH
uses: nicklasfrahm/scp-action@main
with:
direction: upload
host: ${{ secrets.SSH_TARGET_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: |
path/to/source/a.txt
path/to/source/b.txt
target: path/to/target
问题:
1.从main/master下上传,这个main或者master在yml的哪里体现?
2.运行yml时,下面这个选项是干嘛用的?
3.怎么知道,能否直接把密码写入yml, 还是必须用${}来调用? |
|