FTP-Deploy-Action
FTP-Deploy-Action copied to clipboard
How to deploy from subdir into root?!?!
Bug Description Pcheeew. This was my very first time setting up an action. I had the problem that my HUGO repository
- built into a
publicsub-directory and - I wanted this to end up in the root (or a test folder).
- But the action kept loading it into another
publicdirectory on the server!
Well... actually it is solved. It just took me ages to fiddle around with the slashes, quotation marks and arguments :(
I now believe that it is the / at the end of the local-dir: path. But actually: I have no clue! It just works and I'm really scared to touch anything.
I was also playing around with the git-ftp-args: --remote-root until I saw @SamKirkland 's comment somewhere to just use the ftp-server: directly 👍
- maybe this could have another example?
- examples for what the
./actually does? - use cases for
git-ftp-args: --remote-rootand examples?
My Action Config
on:
push:
...
- name: FTP Deploy
uses: SamKirkland/[email protected]
with:
# Deployment destination server & path. Formatted as protocol://domain.com:port/full/destination/path/
ftp-server: ${{ secrets.SERVER }}/domain.com/
ftp-username: ${{ secrets.USER }}
ftp-password: ${{ secrets.PW }}
local-dir: public/
Hi, here is a little suggestion.
I use the following piece of yml.
Assume that your previous CI steps produced an artifact, named build
upload:
name: FTP Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Download Artifact 'build'
uses: actions/download-artifact@master
with:
name: 'build'
path: '${{ github.workspace }}/build'
- name: FTP Deploy
uses: SamKirkland/[email protected]
with:
ftp-server: '${{ secrets.FTP_SERVER }}'
ftp-username: '${{ secrets.FTP_USERNAME }}'
ftp-password: '${{ secrets.FTP_PASSWORD }}'
local-dir: 'build/'
git-ftp-args: '--all'
Create .git-ftp-include file in the root of your repo with the following content
!build/
everything should work out of the box.
Egop, Your solution worked well for me. Thanks
I had a similar issue: FTP-Deploy was deploying in a wrong folder ! :-(
And I found the problem :-) In my target folder there is a sub-folder for my config, but in fact this sub-foder is a symbolic link. When accessing this sub-folder FTP-Deploy was moving to the folder where is the target of the link and it was finishing the deployment there. By excluding properly this sub-folder the problem was solved.
How can you set the upload destination to server root folder - in v4.2.0?
Current upload destination is: root/domain_name/ftp_username
The destination where i need to upload the file is: root
What I've tried, without any success:
- server-dir: ../../
- [nothing]
- server-dir: ././
Do you have any idea how use the root folder as target in this version (4.2.0)?
@AleksandrovC please create a new issues and post your action settings. Also the best solution is to create a FTP account with the default path set to your destination root. Then no settings are needed. You should not be trying to navigate up several folder levels from your default path, most hosts prevent this because you could modify server files (../../../../../../serverConfigFile)