You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `target-server` | Yes | `ftp.samkirkland.com` | | Deployment destination server. Formatted as `domain.com:port`. Port is optional, when not specified it will default to 22 |
66
-
| `remote-user` | Yes | `username@samkirkland.com` | | SSH user name |
| `source-path` | No | `./myFolderToPublish/` | `./` | Path to upload to on the server, must end with trailing slash `/` |
69
-
| `destination-path` | No | `ftp.samkirkland.com` | `./` | Folder to upload from, must end with trailing slash `/` |
70
-
| `rsync-options` | No | See `rsync-options` section below | `--archive --verbose --compress --human-readable --delete --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude.gitignore` | Custom rsync arguments, this field is passed through directly into the rsync script |
63
+
| Key Name | Required? | Example | Default | Description |
| `target-server` | Yes | `ftp.samkirkland.com` | | Deployment destination server. Formatted as `domain.com:port`. Port is optional, when not specified it will default to 22 |
66
+
| `remote-user` | Yes | `username@samkirkland.com` | | SSH user name |
| `source-path` | No | `./myFolderToPublish/` | `./` | Path to upload to on the server, must end with trailing slash `/` |
69
+
| `destination-path` | No | `ftp.samkirkland.com` | `./` | Folder to upload from, must end with trailing slash `/` |
70
+
| `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` | Custom rsync arguments, this field is passed through directly into the rsync script |
71
71
72
72
#### Advanced options using `rsync-options`
73
73
Custom 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.
74
74
You can use as many arguments as you want, seperate them with a space
75
75
76
76
Below is an incomplete list of commonly used args:
| `--archive` | A quick way of saying you want recursion and want to preserve almost everything |
81
+
| `--dry-run` | Does not upload or delete anything, but tells you what it would upload/delete if this was a real deploy |
82
+
| `--stats` | Print verbose statistics on the file transfer, allowing you to tell how effective rsync’s delta-transfer algorithm is for your data |
83
+
| `--links` | When symlinks are encountered, recreate the symlink on the destination |
84
+
| `--compress` | Compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted |
85
+
| `--human-readable` | Output bytes in a more human-readable format (K, M, G) |
86
+
| `--itemize-changes` | itemized list of the changes that are being made to each file, including attribute changes |
87
+
| `--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. |
88
+
| `--max-size '200K'` | Ignore syncing files over this limit. Value is a number followed by "K", "M", or "G" |
89
+
| `--exclude 'file.txt'` | Excludes file(s) from the deployment. Supports glob pattterns (ex: `*.jpg`). You can have multiple excludes! |
90
+
| `--include 'file.txt'` | Includes file(s) even if it was excluded. Supports glob pattterns (ex: `*.jpg`). You can have multiple includes! |
91
+
92
+
See [rsync's manual](https://linux.die.net/man/1/rsync) for all options
90
93
91
94
# Common Examples
92
95
#### Build and Publish React/Angular/Vue Website
@@ -97,24 +100,24 @@ on: push
97
100
name: Publish Website
98
101
jobs:
99
102
web-deploy:
100
-
name: 🚀 Deploy website every commit
103
+
name: 🚀 Deploy Website Every Commit
101
104
runs-on: ubuntu-latest
102
105
steps:
103
-
- name: 🚚 Get latest code
104
-
uses: actions/checkout@v2.1.0
106
+
- name: 🚚 Get Latest Code
107
+
uses: actions/checkout@v3
105
108
106
-
- name: Use Node.js 12.x
107
-
uses: actions/setup-node@v1
109
+
- name: 📦 Install Packages
110
+
- uses: actions/setup-node@v3
108
111
with:
109
-
node-version: '12.x'
112
+
node-version: 18
113
+
cache: "npm"
114
+
- run: npm ci
110
115
111
-
- name: 🔨 Build Project
112
-
run: |
113
-
npm install
114
-
npm run build
116
+
- name: 🔨 Build
117
+
run: npm run build
115
118
116
-
- name: 📂 Sync files
117
-
uses: SamKirkland/web-deploy@1.0.0
119
+
- name: 📂 Sync Files
120
+
uses: SamKirkland/web-deploy@v1.0.0
118
121
with:
119
122
target-server: samkirkland.com
120
123
remote-user: myFtpUserName
@@ -132,10 +135,10 @@ jobs:
132
135
runs-on: ubuntu-latest
133
136
steps:
134
137
- name: 🚚 Get latest code
135
-
uses: actions/checkout@v2.1.0
138
+
uses: actions/checkout@v3
136
139
137
140
- name: 📂 Sync files
138
-
uses: SamKirkland/web-deploy@1.0.0
141
+
uses: SamKirkland/web-deploy@v1.0.0
139
142
with:
140
143
ftp-server: samkirkland.com
141
144
ftp-username: myFTPUsername
@@ -172,40 +175,47 @@ Example excluding a specific folder:
172
175
`rsync-options: --exclude "wp-content/themes/"`
173
176
</details>
174
177
178
+
---
175
179
176
-
<details>
177
-
<summary>How do I set a upload timeout?</summary>
180
+
## Common Errors
181
+
<details id="rsync-not-installed">
182
+
<summary>rsync not found. Please see https://github.com/SamKirkland/web-deploy#rsync-not-installed</summary>
178
183
179
-
github has a built-in `timeout-minutes` option, see customized example below
184
+
185
+
This library uses `rsync` to sync files. The script was not able to detect `rsync` on the machine running the action.
186
+
If you are using `runs-on: ubuntu-latest` you will always have `rsync`.
180
187
181
-
```yaml
182
-
on: push
183
-
name: Publish Website
184
-
jobs:
185
-
web-deploy:
186
-
name: web-deploy
187
-
runs-on: ubuntu-latest
188
-
timeout-minutes: 15 # time out after 15 minutes (default is 360 minutes)
188
+
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.
189
+
190
+
This is pretty easy to do!
191
+
192
+
On `windows` runners run your windows specific steps, then use a `ubuntu-latest` step to deploy.
193
+
194
+
On self-hosted runners install rsync **before** the `web-deploy` step.
0 commit comments