From 3e67e3a3104763561720506d2b3fa94aa27a73ab Mon Sep 17 00:00:00 2001 From: asandikci Date: Sat, 16 Nov 2024 00:08:08 +0300 Subject: [PATCH] use lftp for sftp access and recursive deletion --- .forgejo/workflows/build_and_test.yml | 28 ++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/build_and_test.yml b/.forgejo/workflows/build_and_test.yml index 6a972ee..0dc3dd1 100644 --- a/.forgejo/workflows/build_and_test.yml +++ b/.forgejo/workflows/build_and_test.yml @@ -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 - ! \ No newline at end of file + 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 + # ! \ No newline at end of file