-
Notifications
You must be signed in to change notification settings - Fork 88
56 lines (49 loc) · 1.64 KB
/
sync.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
name: sync-to-china
on:
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: sync # only 1 sync at a time
jobs:
build:
env:
ARKOS_FILE_REPOSITORY: "christianhaitian/arkos"
RSYNC_HOST: 139.196.213.206
#RSYNC_PATH *must* end in a / or it will not work
RSYNC_PATH: /home/kreal/public/arkos/
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v2
name: "debug: ${{github.event_name}}"
- name: Valid proper secrets set
run: |
valid=true
if [[ -z "${{ secrets.RSYNC_USER }}" ]]; then
echo "Please specify a secret: RSYNC_USER for sync to run"
valid=false
fi
if [[ -z "${{ secrets.RSYNC_PASSWORD }}" ]]; then
echo "Please specify a secret: RSYNC_PASSWORD for sync to run"
valid=false
fi
if [[ "$valid" != "true" ]]; then
exit 1
fi
- uses: actions/checkout@v2
- uses: robinraju/[email protected]
with:
repository: "${{env.ARKOS_FILE_REPOSITORY}}"
tag: "v2.0.11.09.2021"
fileName: "*"
- name: rsync files
run: |
rsync_user="${{ secrets.RSYNC_USER }}"
rsync_password='${{ secrets.RSYNC_PASSWORD }}'
rsync_path="${{ env.RSYNC_PATH }}"
rsync_host="${{ env.RSYNC_HOST }}"
sshpass -p "$rsync_password" \
rsync -avz --progress --no-times --no-perms --no-group --no-owner --partial --fuzzy \
--exclude ".*" \
-e "ssh -oStrictHostKeyChecking=no" \
./ $rsync_user@$rsync_host:$rsync_path