Skip to content

Deploys a GitHub project to a FTP server using GitHub actions

License

Notifications You must be signed in to change notification settings

0xDEAD/FTP-Deploy-Action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FTP Deploy for GitHub Actions

Automate deploying websites and more with this GitHub action.

Action

Usage

action "FTP-Deploy-Action" {
   uses = "SamKirkland/FTP-Deploy-Action@master"
   secrets = ["FTP_USERNAME", "FTP_PASSWORD", "FTP_SERVER"]
}
  1. Select the repository you want to add the action to
  2. Select the actions tab (currently only for beta testers)
  3. Select Create a new workflow
  4. Select Edit new file
  5. Paste the above code into the bottom of the file
  6. Go back to the Visual editor
  7. Click edit on the FTP-Deploy-Action
  8. In the secrets section add the required params
    • FTP_USERNAME
    • FTP_PASSWORD
    • FTP_SERVER
    • (see optional settings below)

Settings

  • Options
    • FTP Username: ${FTP_USERNAME}
    • FTP Password: ${FTP_PASSWORD}
    • FTP Server: ${FTP_SERVER}
    • (Optional) Local Dir: ${LOCAL_DIR}
    • (Optional) Remote Dir: ${REMOTE_DIR}
  • Set actions by editing the action then adding them in the secrets section:
    • Action

Explination of steps

  • This action is triggered by a event on your repo
  • A docker image based on mwienk/docker-lftp is spun up on github servers
  • The docker container compresses your code into a tar.gz file
  • The file is then uploaded to the remote server
  • The file is then un-zipped

Debugging locally

Instructions for windows
  • Install docker for windows
  • Open powershell
  • Navigate to the repo folder
  • Run docker build --tag action .
  • (Optional) This step is only required when editing entrypoint.sh due to windows editors saving the file with windows line breaks instead of linux line breaks
    • Download http://dos2unix.sourceforge.net/
    • In another powershell window nagivate to the dos2unix folder /bin
    • Run this command every time you modify entrypoint.sh .\dos2unix.exe "{FULL_PATH_TO_REPO\entrypoint.sh}"
  • Run docker run action
Instructions for linux
  • Please submit a PR for linux instructions :)

ToDo

  • More config options
    • Deploy Mode: ${DEPLOY_MODE} full|diffs
  • SSH support
  • Switch from lftp to git

Pull Requests Welcome!

License


MIT

About

Deploys a GitHub project to a FTP server using GitHub actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 59.3%
  • Shell 40.7%