use lftp for sftp access and recursive deletion
Some checks failed
Build and Deploy Test Version (with/without Drafts) - next.asandikci.com / build-and-push-prod (push) Successful in 1m4s
Build and Deploy Test Version (with/without Drafts) - next.asandikci.com / build-drafts-and-deploy (push) Failing after 1m4s

This commit is contained in:
Aliberk Sandıkçı 2024-11-16 00:08:08 +03:00
parent 99dd009236
commit 3e67e3a310

View file

@ -78,17 +78,19 @@ jobs:
# \-\-disable-external \
# \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
- name: Checkout & Deploy
- name: Deploy
run: |
mkdir deploy && cd deploy
git clone https://git.asandikci.com/asandikci.com/web
cd web
git checkout website
cd _site
echo '${{ secrets.SFTP_PASSWORD }}' > ~/.passwd
chmod 0400 ~/.passwd
sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
rm www/*
put -r . www/
bye
!
mkdir deploy
cp -rfv ../web/_site .
ls -la
lftp --user ${{ secrets.SFTP_USERNAME }} --password ${{ secrets.SFTP_PASSWORD }} sftp://${{ vars.SFTP_HOST }} -e "rm -r www/; mirror -R . www/"
# echo '${{ secrets.SFTP_PASSWORD }}' > ~/.passwd
# chmod 0400 ~/.passwd
# sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
# rm www/*
# put -r . www/
# bye
# !