-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (60 loc) · 1.98 KB
/
ftp-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
57
58
59
60
61
62
63
64
65
66
on: push
name: Deploy with commit message
jobs:
web-deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Get latest code
uses: actions/checkout@v3
- name: Check commit message
id: check-message
run: |
commit_message=$(git log --format=%B -n 1 ${{ github.event.after }})
echo "Commit message: $commit_message"
if [[ "$commit_message" =~ \[deploy\] ]]; then
echo "should_deploy=true" >> $GITHUB_ENV
else
echo "should_deploy=false" >> $GITHUB_ENV
fi
# - name: Sync files
# if: env.should_deploy == 'true'
# uses: SamKirkland/[email protected]
# with:
# server: s36.cyber-folks.pl
# username: [email protected]
# password: rCH-#fg-U_Z791me
# protocol: ftps
# local-dir: ./infohub2024/
# server-dir: public_html/
# - name: Custom FTP Deploy
# if: env.should_deploy == 'true'
# run: |
# lftp -c "
# set ftps:initial-prot '';
# set ftp:ssl-force true;
# open -u [email protected], rCH-#fg-U_Z791me s36.cyber-folks.pl ;
# lcd ./infohub2024/;
# cd public_html/;
# mirror --reverse --delete --verbose ./infohub2024/ public_html/;
# "
- name: Install lftp
if: env.should_deploy == 'true'
run: sudo apt-get update && sudo apt-get install -y lftp
- name: Sync files with lftp
if: env.should_deploy == 'true'
run: |
lftp -c "
set ftps:initial-prot '';
set ftp:ssl-force true;
set ssl:verify-certificate no;
open -u [email protected],rCH-#fg-U_Z791me s36.cyber-folks.pl;
ls;
lcd dsmkt2024;
cd public_html/;
mirror --reverse --delete --verbose ./dsmkt2024/ public_html/;
"
env:
FTP_USERNAME: [email protected]
FTP_PASSWORD: rCH-#fg-U_Z791me
FTP_SERVER: s36.cyber-folks.pl