|
56 | 56 | - name: Install dependencies |
57 | 57 | run: | |
58 | 58 | sudo apt-get update |
59 | | - sudo apt-get install -y sshfs |
| 59 | + sudo apt-get install -y lftp |
60 | 60 | - name: Build |
61 | 61 | if: ${{ inputs.action != 'teardown' }} |
62 | 62 | env: |
@@ -86,50 +86,26 @@ jobs: |
86 | 86 | env: |
87 | 87 | OVH_USERNAME: ${{ secrets.OVH_USERNAME }} |
88 | 88 | OVH_HOSTNAME: ${{ secrets.OVH_HOSTNAME }} |
89 | | - OVH_PASSWORD: ${{ secrets.OVH_PASSWORD }} |
| 89 | + LFTP_PASSWORD: ${{ secrets.OVH_PASSWORD }} |
90 | 90 | TARGET: ${{ inputs.target }} |
91 | 91 | run: | |
92 | 92 | set -exo pipefail |
93 | 93 | mkdir -p ${HOME}/.ssh/ |
94 | | - mkdir -p /tmp/ovh_sshfs |
95 | 94 | ssh-keyscan "${OVH_HOSTNAME}" >> "${HOME}/.ssh/known_hosts" |
96 | | - sshfs "${OVH_USERNAME}@${OVH_HOSTNAME}:/home/${OVH_USERNAME}" \ |
97 | | - /tmp/ovh_sshfs \ |
98 | | - -o ssh_command="sshpass -p ${OVH_PASSWORD} ssh" \ |
99 | | - -o kernel_cache \ |
100 | | - -o attr_timeout=600 \ |
101 | | - -o entry_timeout=600 \ |
102 | | - -o negative_timeout=600 \ |
103 | | - -o compression=no \ |
104 | | - -o PreferredAuthentications=password \ |
105 | | - -o Ciphers=aes128-gcm@openssh.com \ |
106 | | - -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 \ |
107 | | - -o max_conns=4 |
108 | | - if [ ! "/tmp/ovh_sshfs/www/" = "/tmp/ovh_sshfs/www/${TARGET}" ] && [ ! -d "/tmp/ovh_sshfs/www/${TARGET}" ]; then |
109 | | - pushd /tmp/ovh_sshfs/www |
110 | | - find . -not \( -path './preview*' -prune \) -type d | xargs -P32 -I{} mkdir -p "./${TARGET}/{}" |
111 | | - find . -not \( -path './preview*' -prune \) -not -type d | xargs -P32 -I{} ln -s /tmp/ovh_sshfs/www/{} "/tmp/ovh_sshfs/www/${TARGET}/{}" |
112 | | - popd |
113 | | - rsync --verbose --recursive --checksum --delete --delay-updates --link-dest="/tmp/ovh_sshfs/www" ./output/ "/tmp/ovh_sshfs/www/${TARGET}" |
114 | | - else |
115 | | - rsync --verbose --recursive --checksum --delete --delay-updates --exclude=preview ./output/ "/tmp/ovh_sshfs/www/${TARGET}" |
116 | | - fi |
117 | | - fusermount -u /tmp/ovh_sshfs |
| 95 | + lftp --env-password -u ${OVH_USERNAME} sftp://${OVH_HOSTNAME} \ |
| 96 | + -e "set sftp:connect-program \"ssh -o Compression=no\"; set mirror:parallel-transfer-count 16; set mirror:parallel-directories yes; mirror --delete -P 16 -R ./output /home/${OVH_USERNAME}/www/${TARGET}; quit" |
| 97 | +
|
118 | 98 | - name: Delete website |
119 | 99 | if: ${{ inputs.action == 'teardown' }} |
120 | 100 | env: |
121 | 101 | OVH_USERNAME: ${{ secrets.OVH_USERNAME }} |
122 | 102 | OVH_HOSTNAME: ${{ secrets.OVH_HOSTNAME }} |
123 | | - OVH_PASSWORD: ${{ secrets.OVH_PASSWORD }} |
| 103 | + LFTP_PASSWORD: ${{ secrets.OVH_PASSWORD }} |
124 | 104 | TARGET: ${{ inputs.target }} |
125 | 105 | run: | |
126 | 106 | set -exo pipefail |
127 | 107 | mkdir -p ${HOME}/.ssh/ |
128 | 108 | mkdir -p /tmp/ovh_sshfs |
| 109 | + mkdir empty |
129 | 110 | ssh-keyscan "${OVH_HOSTNAME}" >> "${HOME}/.ssh/known_hosts" |
130 | | - sshfs "${OVH_USERNAME}@${OVH_HOSTNAME}:/home/${OVH_USERNAME}" \ |
131 | | - /tmp/ovh_sshfs \ |
132 | | - -o ssh_command="sshpass -p ${OVH_PASSWORD} ssh -o PreferredAuthentications=password" \ |
133 | | - -o max_conns=16 & |
134 | | - rm -rf "/tmp/ovh_sshfs/www/${TARGET}" |
135 | | - kill %1 |
| 111 | + lftp --env-password -u ${OVH_USERNAME} sftp://${OVH_HOSTNAME} -e "set sftp:connect-program \"ssh -o Compression=no\"; set mirror:parallel-transfer-count 16; set mirror:parallel-directories yes; mirror --delete -P 16 -R ./empty /home/${OVH_USERNAME}/www/${TARGET}; rmdir /home/${OVH_USERNAME}/www/${TARGET}; quit" |
0 commit comments