Semaphore has LFTP, an FTP/HTTP client and a file transfer program, installed by default. LFTP can be used with the Generic Deployment method on Semaphore.
The first step is to create 2 environment variables that will allow LFTP to access your server. Visit the project settings environment variables tab and create 2 new environment variables, FTP_USER and FTP_PASSWORD. Feel free to encrypt the FTP_PASSWORD variable.
Next, go to the dashboard and press "Set Up Deployment" button for that project.
Choose the Generic Deployment method.
The next step is choosing your deployment strategy. Semaphore supports two deployment strategies, Automatic and Manual. You can read more about them here.
If you choose the automatic deployment strategy, you need to select the branch that will be automatically deployed.
After that, you need to set the commands that will perform the deploy. With LFTP, you can deploy your application using a single line:
lftp -c "open -u $FTP_USER,$FTP_PASSWORD YOUR_FTP_HOST; set ssl:verify-certificate no; mirror -R ./ YOUR_REMOTE_PATH"
Copy the line and paste it in the deploy commands text area.
Here, $FTP_USER and $FTP_PASSWORD are environment variables that we previously defined.
Replace YOUR_FTP_HOST and YOUR_REMOTE_PATH with corresponding values.
Next, set a meaningful name for the new deployment target.
After that, FTP deployment is fully configured. You can trigger the first deploy manually right from the new server page.
Semaphore Docs are open source — Edit on GitHub