{"id":13533538,"url":"https://github.com/SamKirkland/FTP-Deploy-Action","last_synced_at":"2025-04-01T21:32:25.720Z","repository":{"id":37733465,"uuid":"164189968","full_name":"SamKirkland/FTP-Deploy-Action","owner":"SamKirkland","description":"Deploys a GitHub project to a FTP server using GitHub actions","archived":false,"fork":false,"pushed_at":"2024-03-02T06:42:22.000Z","size":747,"stargazers_count":4170,"open_issues_count":128,"forks_count":384,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-03-26T22:07:53.227Z","etag":null,"topics":["action","actions","continuous-deployment","continuous-integration","deploy-action","deployment-automation","github-actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamKirkland.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-05T06:48:31.000Z","updated_at":"2025-03-25T12:01:59.000Z","dependencies_parsed_at":"2023-02-17T17:00:54.600Z","dependency_job_id":"5f23df4e-9149-4c09-abfb-ed00e7acbe97","html_url":"https://github.com/SamKirkland/FTP-Deploy-Action","commit_stats":{"total_commits":100,"total_committers":18,"mean_commits":5.555555555555555,"dds":0.52,"last_synced_commit":"c15ea8f529bb8d4daf7898abe8631e4aa5cf15b7"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2FFTP-Deploy-Action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2FFTP-Deploy-Action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2FFTP-Deploy-Action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2FFTP-Deploy-Action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamKirkland","download_url":"https://codeload.github.com/SamKirkland/FTP-Deploy-Action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245966972,"owners_count":20701758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","actions","continuous-deployment","continuous-integration","deploy-action","deployment-automation","github-actions"],"created_at":"2024-08-01T07:01:20.777Z","updated_at":"2025-04-01T21:32:25.301Z","avatar_url":"https://github.com/SamKirkland.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Community Resources"],"sub_categories":["Deployment"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"FTP Deploy Action - Continuous integration for everyone\" src=\"images/ftp-deploy-logo-small.png\"\u003e\n\u003c/p\u003e\n\nAutomate deploying websites and more with this GitHub action. **It's free!**\n\n![FTP test](https://github.com/SamKirkland/FTP-Deploy-Action/workflows/FTP%20Test/badge.svg)\n![FTPS test](https://github.com/SamKirkland/FTP-Deploy-Action/workflows/FTPS%20Test/badge.svg)\n\n---\n\n### Usage Example\nPlace the following in `/.github/workflows/main.yml`\n```yml\non: push\nname: 🚀 Deploy website on push\njobs:\n  web-deploy:\n    name: 🎉 Deploy\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get latest code\n      uses: actions/checkout@v4\n    \n    - name: 📂 Sync files\n      uses: SamKirkland/FTP-Deploy-Action@v4.3.5\n      with:\n        server: ftp.samkirkland.com\n        username: myFtpUserName\n        password: ${{ secrets.ftp_password }}\n```\n\n---\n\n### Requirements\n- You must have ftp access to your server. If your host allows or requires ssh please use my [web-deploy](https://github.com/SamKirkland/web-deploy) action\n- Some web hosts change the default port (21), check with your host for your port number\n\n---\n\n### Setup Steps\n1. Select the repository you want to add the action to\n2. Select the `Actions` tab\n3. Select `Blank workflow file` or `Set up a workflow yourself`, if you don't see these options manually create a yaml file `Your_Project/.github/workflows/main.yml`\n4. Paste the example above into your yaml file and save\n5. Now you need to add a key to the `secrets` section in your project. To add a `secret` go to the `Settings` tab in your project then select `Secrets`. Add a new `Secret` for `password`\n6. Update your yaml file settings\n7. If you appreciate this github action give it a :star: or show off with one of the [badges below](#badge).\n\n---\n\n### Settings\nKeys can be added directly to your .yml config file or referenced from your project `Secrets` storage.\n\nTo add a `secret` go to the `Settings` tab in your project then select `Secrets`.\nI strongly recommend you store your `password` as a secret.\n\n| Key Name                | Required | Example                       | Default Value                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n|-------------------------|----------|-------------------------------|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `server`                | Yes      | `ftp.samkirkland.com`         |                               | Deployment destination server                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| `username`              | Yes      | `username@samkirkland.com`    |                               | FTP user name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| `password`              | Yes      | `CrazyUniquePassword\u0026%123`    |                               | FTP password, be sure to escape quotes and spaces                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| `port`                  | No       | `990`                         | `21`                          | Server port to connect to (read your web hosts docs)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| `protocol`              | No       | `ftps`                        | `ftp`                         | `ftp`: provides no encryption, `ftps`: full encryption newest standard (aka \"explicit\" ftps), `ftps-legacy`: full encryption legacy standard (aka \"implicit\" ftps)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| `local-dir`             | No       | `./myFolderToPublish/`        | `./`                          | Folder to upload from, must end with trailing slash `/`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| `server-dir`            | No       | `public_html/www/`            | `./`                          | Folder to upload to (on the server), must end with trailing slash `/`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| `state-name`            | No       | `folder/.sync-state.json`     | `.ftp-deploy-sync-state.json` | Path and name of the state file - this file is used to track which files have been deployed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| `dry-run`               | No       | `true`                        | `false`                       | Prints which modifications will be made with current config options, but doesn't actually make any changes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n| `dangerous-clean-slate` | No       | `true`                        | `false`                       | Deletes ALL contents of server-dir, even items in excluded with 'exclude' argument                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| `exclude`               | No       | [See Example](#exclude-files) | [See Example](#exclude-files) | An array of glob patterns, these files will not be included in the publish/delete process. [List MUST be in this format](#exclude-files). You can use [a glob tester](https://www.digitalocean.com/community/tools/glob?comments=true\u0026glob=%2A%2A%2F.git%2A%2F%2A%2A\u0026matches=false\u0026tests=test%2Fsam\u0026tests=.git%2F%0D\u0026tests=.github%2F%0D\u0026tests=.git%2Ftest%0D\u0026tests=.gitattributes%0D\u0026tests=.gitignore%0D\u0026tests=.git%2Fconfig%0D\u0026tests=.git%2Ftest%2Ftest\u0026tests=.github%2Fworkflows%2Fmain.yml\u0026tests=node_modules%2Ffolder%2F%0D\u0026tests=node_modules%2Fotherfolder%2F%0D\u0026tests=subfolder%2Fnode_modules%2F) to test your pattern(s). |\n| `log-level`             | No       | `minimal`                     | `standard`                    | `minimal`: only important info, `standard`: important info and basic file changes, `verbose`: print everything the script is doing                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| `security`              | No       | `strict`                      | `loose`                       | `strict`: Reject any connection which is not authorized with the list of supplied CAs. `loose`: Allow connection even when the domain is not certificate                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| `timeout`               | No       | `60000`                       | `30000`                       | Timeout in milliseconds for FTP operations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n\n\n# Common Examples\n#### Build and Publish React/Angular/Vue Website\nMake sure you have an npm script named 'build'. This config should work for most node built websites.\n\n```yml\non: push\nname: 🚀 Deploy website on push\njobs:\n  web-deploy:\n    name: 🎉 Deploy\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get latest code\n      uses: actions/checkout@v4\n\n    - name: Use Node.js 16\n      uses: actions/setup-node@v2\n      with:\n        node-version: '16'\n      \n    - name: 🔨 Build Project\n      run: |\n        npm install\n        npm run build\n    \n    - name: 📂 Sync files\n      uses: SamKirkland/FTP-Deploy-Action@v4.3.5\n      with:\n        server: ftp.samkirkland.com\n        username: myFtpUserName\n        password: ${{ secrets.password }}\n```\n\n#### FTPS\n```yml\non: push\nname: 🚀 Deploy website on push\njobs:\n  web-deploy:\n    name: 🎉 Deploy\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get latest code\n      uses: actions/checkout@v4\n\n    - name: 📂 Sync files\n      uses: SamKirkland/FTP-Deploy-Action@v4.3.5\n      with:\n        server: ftp.samkirkland.com\n        username: myFtpUserName\n        password: ${{ secrets.password }}\n        protocol: ftps\n        port: 1234 # todo replace with your web hosts ftps port\n```\n\n#### Log only dry run: Use this option for testing\nOuputs a list of files that will be created/modified to sync your source without making any actual changes\n```yml\non: push\nname: 🚀 Deploy website on push\njobs:\n  web-deploy:\n    name: 🎉 Deploy\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get latest code\n      uses: actions/checkout@v4\n\n    - name: 📂 Sync files\n      uses: SamKirkland/FTP-Deploy-Action@v4.3.5\n      with:\n        server: ftp.samkirkland.com\n        username: myFtpUserName\n        password: ${{ secrets.password }}\n        dry-run: true\n```\n\n#### Exclude files\nExcludes files\n```yml\non: push\nname: 🚀 Deploy website on push\njobs:\n  web-deploy:\n    name: 🎉 Deploy\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get latest code\n      uses: actions/checkout@v4\n\n    - name: 📂 Sync files\n      uses: SamKirkland/FTP-Deploy-Action@v4.3.5\n      with:\n        server: ftp.samkirkland.com\n        username: myFtpUserName\n        password: ${{ secrets.password }}\n        exclude: |\n          **/.git*\n          **/.git*/**\n          **/node_modules/**\n          fileToExclude.txt\n```\n\n`exclude` has the following default value\n```yml\nexclude: |\n  **/.git*\n  **/.git*/**\n  **/node_modules/**\n```\nif you overwrite the default value you will probably want to respecify them\n\n\n---\n\n_Want another example? Let me know by creating a [github issue](https://github.com/SamKirkland/FTP-Deploy-Action/issues/new)_\n\n---\n\n## Badge\n\nIf you appreciate this github action give it a :star: or show off with one of the badges below. Feel free to edit the text or color.\n\n[\u003cimg alt=\"Deployed with FTP Deploy Action\" src=\"https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=0077b6\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n\n```md\n[\u003cimg alt=\"Deployed with FTP Deploy Action\" src=\"https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=0077b6\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n```\n\n[\u003cimg alt=\"Deployed with FTP Deploy Action\" src=\"https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n\n```md\n[\u003cimg alt=\"Deployed with FTP Deploy Action\" src=\"https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n```\n\n[\u003cimg alt=\"Deployed with FTP Deploy Action\" src=\"https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n\n```md\n[\u003cimg alt=\"Deployed with FTP Deploy Action\" src=\"https://img.shields.io/badge/Deployed With-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n```\n\n---\n\n[\u003cimg alt=\"Website Deployed for Free with FTP Deploy Action\" src=\"https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=297FA9\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n\n```md\n[\u003cimg alt=\"Website Deployed for Free with FTP Deploy Action\" src=\"https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=297FA9\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n```\n\n[\u003cimg alt=\"Website Deployed for Free with FTP Deploy Action\" src=\"https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n\n```md\n[\u003cimg alt=\"Website Deployed for Free with FTP Deploy Action\" src=\"https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n```\n\n[\u003cimg alt=\"Website Deployed for Free with FTP Deploy Action\" src=\"https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n\n```md\n[\u003cimg alt=\"Website Deployed for Free with FTP Deploy Action\" src=\"https://img.shields.io/badge/Website deployed for free with-FTP DEPLOY ACTION-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/FTP-Deploy-Action)\n```\n\n---\n\n## FAQ\n\u003cdetails\u003e\n  \u003csummary\u003eHow to exclude .git files from the publish\u003c/summary\u003e\n\nGit files are excluded by default! If you customize the `exclude` option make sure you re-add the default options.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to exclude a specific file or folder\u003c/summary\u003e\n\nYou can use the `exclude` option to ignore specific files/folders from the publish. Keep in mind you will need to re-add the default exclude options if you want to keep them. For example the below option excludes all `.txt` files.\n\n```yml\nexclude:\n - *.txt\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow do I set a upload timeout?\u003c/summary\u003e\n\ngithub has a built-in `timeout-minutes` option, see customized example below\n\n```yaml\non: push\nname: Publish Website\njobs:\n  web-deploy:\n    name: web-deploy\n    runs-on: ubuntu-latest\n    timeout-minutes: 15 # time out after 15 minutes (default is 360 minutes)\n    steps:\n      ....\n```\n\u003c/details\u003e\n\n## Debugging your config locally\nThis action is a basic wrapper around my `@samkirkland/ftp-deploy` npm package. To test your config you can install [@samkirkland/ftp-deploy](https://github.com/SamKirkland/ftp-deploy) and then convert your config to a yml action. Settings are one-to-one, this action is only a wrapper.\n\n## Contributing to this project\nTo test this action locally you will need to setup **docker** and **act** to run a environment similar to the one github uses for actions.\n- Download/install docker for windows, make sure it is running\n- `choco install act-cli` install [act](https://github.com/nektos/act)\n- Install the npm package using `npm install --dev-only @samkirkland/ftp-deploy`\n- Update the `deploy` script in `package.json` with a actual server/username/password\n- You can run the script using the following command `npm run deploy` (run this in the folder that has the `package.json` file)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamKirkland%2FFTP-Deploy-Action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSamKirkland%2FFTP-Deploy-Action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamKirkland%2FFTP-Deploy-Action/lists"}