I'm using milanmk/actions-file-deployer for this. You can read more here https://medium.com/@irina.grigoryan97/automatically-deploy-files-from-github-to-a-server-using-sftp-and-github-actions-d1c7761f5d97
# This is a composite GitHub Action (Linux runner)
# for deploying repository content to remote server
- name: SFTP-Deploy-Action
uses: milanmk/actions-file-deployer@master
with:
remote-protocol: sftp
# Credentials for SFTP access to server using GitHub secrets
remote-host: ${{ secrets.FTP_HOST }}
remote-user: ${{ secrets.FTP_USER }}
remote-password: ${{ secrets.FTP_PASSWORD }}
# Path for specific folder on server for files deployment
remote-path: /test.net/deploy-test
# Port for SFTP access to server
remote-port: 221