|
| 1 | +# FTP Deploy for GitHub Actions |
| 2 | + |
| 3 | +Automate deploying websites and more with this GitHub action. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +### Usage |
| 8 | +``` |
| 9 | +action "FTP-Deploy-Action" { |
| 10 | + uses = "SamKirkland/FTP-Deploy-Action@master" |
| 11 | + secrets = ["FTP_USERNAME", "FTP_PASSWORD", "FTP_SERVER"] |
| 12 | +} |
| 13 | +``` |
| 14 | + |
| 15 | +1. Select the repository you want to add the action to |
| 16 | +2. Select the actions tab `(currently only for beta testers)` |
| 17 | +3. Select `Create a new workflow` |
| 18 | +4. Select `Edit new file` |
| 19 | +5. Paste the above code into the bottom of the file |
| 20 | +6. Go back to the `Visual editor` |
| 21 | +7. Click edit on the `FTP-Deploy-Action` |
| 22 | +8. In the `secrets` section add the required params |
| 23 | + * FTP_USERNAME |
| 24 | + * FTP_PASSWORD |
| 25 | + * FTP_SERVER |
| 26 | + * (see optional settings below) |
| 27 | + |
| 28 | +### Settings |
| 29 | +- Options |
| 30 | + - __FTP Username__: ${FTP_USERNAME} |
| 31 | + - __FTP Password__: ${FTP_PASSWORD} |
| 32 | + - __FTP Server__: ${FTP_SERVER} |
| 33 | + - __(Optional) Local Dir__: ${LOCAL_DIR} |
| 34 | + - __(Optional) Remote Dir__: ${REMOTE_DIR} |
| 35 | +- Set actions by editing the action then adding them in the `secrets` section: |
| 36 | + -  |
| 37 | + |
| 38 | + |
| 39 | +### Explination of steps |
| 40 | +- This action is triggered by a `event` on your repo |
| 41 | +- A docker image based on `mwienk/docker-lftp` is spun up on github servers |
| 42 | +- The docker container compresses your code into a tar.gz file |
| 43 | +- The file is then uploaded to the remote server |
| 44 | +- The file is then un-zipped |
| 45 | + |
| 46 | +### Debugging locally |
| 47 | +###### Instructions for windows |
| 48 | +- Install docker for windows |
| 49 | +- Open powershell |
| 50 | +- Navigate to the repo folder |
| 51 | +- Run `docker build --tag action .` |
| 52 | +- (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 |
| 53 | + - Download http://dos2unix.sourceforge.net/ |
| 54 | + - In another powershell window nagivate to the dos2unix folder /bin |
| 55 | + - Run this command every time you modify entrypoint.sh `.\dos2unix.exe "{FULL_PATH_TO_REPO\entrypoint.sh}"` |
| 56 | +- Run `docker run action` |
| 57 | + |
| 58 | +###### Instructions for linux |
| 59 | +- Please submit a PR for linux instructions :) |
| 60 | + |
| 61 | + |
| 62 | +### ToDo |
| 63 | +- More config options |
| 64 | + - Deploy Mode: ${DEPLOY_MODE} `full`|`diffs` |
| 65 | +- SSH support |
| 66 | +- Switch from lftp to git |
| 67 | + |
| 68 | +Pull Requests Welcome! |
| 69 | + |
| 70 | +### License |
| 71 | +---- |
| 72 | + |
| 73 | +MIT |
0 commit comments