-
Notifications
You must be signed in to change notification settings - Fork 53
89 lines (87 loc) · 2.63 KB
/
scp-example-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: scp copy folder to remote via SSH
on:
push
jobs:
build:
runs-on: ubuntu-latest
env:
CI: true
LOCAL: test
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup demo
run: |
mkdir test
touch test/oof.txt
touch test/.dot.txt
- name: Copy folder content recursively to remote
uses: ./
with:
local: test
remote: scp/directory
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
privateKey: ${{ secrets.PRIVATE_KEY}}
- name: Copy folder content recursively to remote (clean directory)
uses: ./
with:
local: test
remote: scp/directory
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
privateKey: ${{ secrets.PRIVATE_KEY}}
rmRemote: true
dotfiles: true
- name: Copy folder content recursively to remote (atomic put)
uses: ./
with:
local: test
remote: scp/atomic
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
privateKey: ${{ secrets.PRIVATE_KEY}}
rmRemote: true
dotfiles: true
atomicPut: true
- name: Copy single file to remote
uses: ./
with:
local: test/oof.txt
remote: scp/single/readme.md
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
privateKey: ${{ secrets.PRIVATE_KEY}}
- name: Copy dotfile to remote
uses: ./
with:
local: test/.dot.txt
remote: scp/single/.dot.txt
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
privateKey: ${{ secrets.PRIVATE_KEY}}
dotfiles: true
- name: Copy with user/pw
uses: ./
with:
local: test/oof.txt
remote: scp/user/pw/oof.txt
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
- name: With ENV
uses: ./
with:
local: ${{ env.LOCAL }}
remote: scp/directory
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
privateKey: ${{ secrets.PRIVATE_KEY}}
rmRemote: true
dotfiles: true