{"id":14985966,"url":"https://github.com/samkirkland/web-deploy","last_synced_at":"2025-03-31T07:05:01.244Z","repository":{"id":65155283,"uuid":"261375873","full_name":"SamKirkland/web-deploy","owner":"SamKirkland","description":"Deploy your website automatically for free","archived":false,"fork":false,"pushed_at":"2024-05-13T13:20:58.000Z","size":142,"stargazers_count":212,"open_issues_count":17,"forks_count":34,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T07:04:55.427Z","etag":null,"topics":["action","continuous-deployment","continuous-integration","deploy","deployment","rsync","ssh","website"],"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":"2020-05-05T06:11:55.000Z","updated_at":"2025-03-20T15:17:05.000Z","dependencies_parsed_at":"2024-06-18T18:52:26.192Z","dependency_job_id":null,"html_url":"https://github.com/SamKirkland/web-deploy","commit_stats":{"total_commits":12,"total_committers":3,"mean_commits":4.0,"dds":0.5,"last_synced_commit":"7d7a529dd2384687ccc1d3e251d8c7f164fbc533"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fweb-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fweb-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fweb-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fweb-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamKirkland","download_url":"https://codeload.github.com/SamKirkland/web-deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246429461,"owners_count":20775806,"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","continuous-deployment","continuous-integration","deploy","deployment","rsync","ssh","website"],"created_at":"2024-09-24T14:12:03.195Z","updated_at":"2025-03-31T07:05:01.210Z","avatar_url":"https://github.com/SamKirkland.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"web deploy - Continuous integration for everyone\" src=\"images/web-deploy-logo-small.png\"\u003e\n\u003c/p\u003e\n\nAutomate deploying websites and more with this GitHub action. **It's free!**\n\n[![tests](https://github.com/SamKirkland/web-deploy/actions/workflows/test-report.yml/badge.svg)](https://github.com/SamKirkland/web-deploy/actions/workflows/test-report.yml)\n\n---\n\n### Usage Example\nPlace the following in `Your_Project/.github/workflows/main.yml`\n```yml\non: push\nname: Publish Website\njobs:\n  web-deploy:\n    name: 🚀 Deploy Website Every Commit\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get Latest Code\n      uses: actions/checkout@v3\n    \n    - name: 📂 Sync Files\n      uses: SamKirkland/web-deploy@v1\n      with:\n        target-server: example.com\n        remote-user: username\n        private-ssh-key: ${{ secrets.SSH_KEY }}\n        destination-path: ~/destinationFolder/\n```\n\n---\n\n### Requirements\n- You must have shell access to your server, please read you webite hosts documentation\n- **You CANNOT use a FTP account - they are not the same!**\n  - If you don't have SSH access but have ftp access use [FTP-Deploy-Action](https://github.com/SamKirkland/FTP-Deploy-Action) instead\n- You will need to create a **SSH** user to deploy. Normally this is your cpanel or hosting providers username and password\n- Most web hosts change the default port (22), 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 `private-ssh-key`\n6. Update your yaml file settings\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 `private-ssh-key` as a secret.\n\n| Key Name           | Required? | Example                                  | Default                                                                                                                                                                  | Description                                                                                                                                                        |\n|--------------------|-----------|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `target-server`    | Yes       | `example.com`                            |                                                                                                                                                                          | Destination server to deploy to                                                                                                                                    |\n| `destination-path` | Yes       | `~/folderOnServerThatAlreadyExists/`     |                                                                                                                                                                          | Path on the server to deploy to. Must already exist.                                                                                                               |\n| `remote-user`      | Yes       | `username`                               |                                                                                                                                                                          | SSH user to login as                                                                                                                                               |\n| `private-ssh-key`  | Yes       | `-----BEGIN RSA PRIVATE KEY----- ......` |                                                                                                                                                                          | SSH Private key. Must be specified as a secret.                                                                                                                    |\n| `source-path`      | No        | `./myFolderToPublish/`                   | `./`                                                                                                                                                                     | Path to upload to on the server, must end with trailing slash `/`                                                                                                  |\n| `ssh-port`         | No        | `12345`                                  | `22`                                                                                                                                                                     | SSH port to use. Most hosts change this from the default. This is NOT your websites port.                                                                          |\n| `rsync-options`    | No        | See `rsync-options` section below        | `--archive --verbose --compress --human-readable --progress --delete-after --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore` | Note: If customizing you should re-specify defaults (assuming you want them). Custom rsync arguments, this field is passed through directly into the rsync script. |\n\n#### Advanced options using `rsync-options`\nCustom arguments, this field is passed through directly into the rsync script. See [rsync's manual](https://linux.die.net/man/1/rsync) for all options.\nYou can use as many arguments as you want, seperate them with a space\n\nBelow is an incomplete list of commonly used args:\n\n| Option                 | Description                                                                                                                                |\n|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| `--archive`            | A quick way of saying you want recursion and want to preserve almost everything                                                            |\n| `--dry-run`            | Does not upload or delete anything, but tells you what it would upload/delete if this was a real deploy                                    |\n| `--stats`              | Print verbose statistics on the file transfer, allowing you to tell how effective rsync’s delta-transfer algorithm is for your data        |\n| `--links`              | When symlinks are encountered, recreate the symlink on the destination                                                                     |\n| `--compress`           | Compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted                      |\n| `--human-readable`     | Output bytes in a more human-readable format (K, M, G)                                                                                     |\n| `--itemize-changes`    | itemized list of the changes that are being made to each file, including attribute changes                                                 |\n| `--delete-after`       | When you delete a file on github it will also be deleted on the server. Files are deleted at the end of a deployment to minimize downtime. |\n| `--max-size '200K'`    | Ignore syncing files over this limit. Value is a number followed by \"K\", \"M\", or \"G\"                                                       |\n| `--exclude 'file.txt'` | Excludes file(s) from the deployment. Supports glob pattterns (ex: `*.jpg`). You can have multiple excludes!                               |\n| `--include 'file.txt'` | Includes file(s) even if it was excluded. Supports glob pattterns (ex: `*.jpg`). You can have multiple includes!                           |\n\nSee [rsync's manual](https://linux.die.net/man/1/rsync) for all options\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: Publish Website\njobs:\n  web-deploy:\n    name: 🚀 Deploy Website Every Commit\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get Latest Code\n      uses: actions/checkout@v3\n\n    - name: 📦 Install Packages\n    - uses: actions/setup-node@v3\n      with:\n        node-version: 18\n        cache: \"npm\"\n    - run: npm ci\n      \n    - name: 🔨 Build\n      run: npm run build\n    \n    - name: 📂 Sync Files\n      uses: SamKirkland/web-deploy@v1\n      with:\n        target-server: example.com\n        remote-user: username\n        private-ssh-key: ${{ secrets.SSH_KEY }}\n        destination-path: ~/destinationFolder/\n```\n\n#### Log only dry run: Use this mode 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: Publish Website Dry Run\njobs:\n  web-deploy:\n    name: 🚀 Deploy Website Every Commit\n    runs-on: ubuntu-latest\n    steps:\n    - name: 🚚 Get Latest Code\n      uses: actions/checkout@v3\n\n    - name: 📂 Sync Files\n      uses: SamKirkland/web-deploy@v1\n      with:\n        target-server: example.com\n        remote-user: username\n        private-ssh-key: ${{ secrets.SSH_KEY }}\n        ssh-port: 22\n        destination-path: ~/destinationFolder/\n        rsync-options: --dry-run --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore\n```\n\n_Want another example? Let me know by creating a [github issue](https://github.com/SamKirkland/web-deploy/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 web deploy\" src=\"https://img.shields.io/badge/Deployed With-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=0077b6\"\u003e](https://github.com/SamKirkland/web-deploy)\n\n```md\n[\u003cimg alt=\"Deployed with web deploy\" src=\"https://img.shields.io/badge/Deployed With-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=0077b6\"\u003e](https://github.com/SamKirkland/web-deploy)\n```\n\n[\u003cimg alt=\"Deployed with web deploy\" src=\"https://img.shields.io/badge/Deployed With-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/web-deploy)\n\n```md\n[\u003cimg alt=\"Deployed with web deploy\" src=\"https://img.shields.io/badge/Deployed With-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/web-deploy)\n```\n\n[\u003cimg alt=\"Deployed with web deploy\" src=\"https://img.shields.io/badge/Deployed With-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/web-deploy)\n\n```md\n[\u003cimg alt=\"Deployed with web deploy\" src=\"https://img.shields.io/badge/Deployed With-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/web-deploy)\n```\n\n---\n\n[\u003cimg alt=\"Website Deployed for Free with web deploy\" src=\"https://img.shields.io/badge/Website deployed for free with-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=297FA9\"\u003e](https://github.com/SamKirkland/web-deploy)\n\n```md\n[\u003cimg alt=\"Website Deployed for Free with web deploy\" src=\"https://img.shields.io/badge/Website deployed for free with-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=297FA9\"\u003e](https://github.com/SamKirkland/web-deploy)\n```\n\n[\u003cimg alt=\"Website Deployed for Free with web deploy\" src=\"https://img.shields.io/badge/Website deployed for free with-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/web-deploy)\n\n```md\n[\u003cimg alt=\"Website Deployed for Free with web deploy\" src=\"https://img.shields.io/badge/Website deployed for free with-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=2b9348\"\u003e](https://github.com/SamKirkland/web-deploy)\n```\n\n[\u003cimg alt=\"Website Deployed for Free with web deploy\" src=\"https://img.shields.io/badge/Website deployed for free with-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/web-deploy)\n\n```md\n[\u003cimg alt=\"Website Deployed for Free with web deploy\" src=\"https://img.shields.io/badge/Website deployed for free with-web deploy-%3CCOLOR%3E?style=for-the-badge\u0026color=d00000\"\u003e](https://github.com/SamKirkland/web-deploy)\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\n\nIf have customized `rsync-options` you will need to re-add the default exclude options using `--exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore`\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 `rsync-options` and pass in as many `--exclude` options as you want. By default this action excludes github files. If you choose to customize `rsync-options` make sure you copy over the defaults.\n\n\nExample excluding all `.jpg` files:\n\n`rsync-options: --exclude \"*.jpg\"`\n\n\nExample excluding a specific folder:\n\n`rsync-options: --exclude \"wp-content/themes/\"`\n\u003c/details\u003e\n\n---\n\n## Common Errors\n\u003cdetails id=\"rsync-not-installed\"\u003e\n  \u003csummary\u003ersync not found. Please see https://github.com/SamKirkland/web-deploy#rsync-not-installed\u003c/summary\u003e\n\n  \n  This library uses `rsync` to sync files. The script was not able to detect `rsync` on the machine running the action.\n  If you are using `runs-on: ubuntu-latest` you will always have `rsync`.\n\n  If you are using `windows-latest`, `windows-XXXX`, `macos-latest`, `macos-12` or a [self-hosted](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) runner you will need to install rsync before the `web-deploy` step.\n\n  This is pretty easy to do!\n\n  On `windows` runners run your windows specific steps, then use a `ubuntu-latest` step to deploy.\n\n  On self-hosted runners install rsync **before** the `web-deploy` step.\n  ```yaml\n    runs-on: [self-hosted, linux, my-self-hosted-runner-label]\n    steps:\n      - name: Install rsync\n        run: |\n          sudo apt-get update\n          sudo apt-get install rsync\n  ```\n\n  On `macos` runners install rsync **before** the `web-deploy` step.\n  ```yaml\n    runs-on: macos-latest\n    steps:\n      - name: Install rsync\n        run: |\n          brew update\n          brew install rsync\n  ```\n\n  [Read more about customizing runners](https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners)\n\n\n\n  https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners\n\u003c/details\u003e\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkirkland%2Fweb-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamkirkland%2Fweb-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkirkland%2Fweb-deploy/lists"}