Skip to content

Commit c42c8e4

Browse files
committed
Updating ReadMe FAQ Section
1 parent c926b9d commit c42c8e4

File tree

2 files changed

+102
-29
lines changed

2 files changed

+102
-29
lines changed

README.md

Lines changed: 102 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
Automate deploying websites and more with this GitHub action
66

7-
![Action](images/action-preview.gif)
8-
97
![Test FTP Deploy](https://github.com/SamKirkland/FTP-Deploy-Action/workflows/Test%20FTP%20Deploy/badge.svg) ![Test SFTP Deploy](https://github.com/SamKirkland/FTP-Deploy-Action/workflows/Test%20SFTP%20Deploy/badge.svg)
108

11-
### Usage Example (Your_Project/.github/workflows/main.yml)
9+
---
10+
11+
### Usage Example
12+
13+
Place the following in `Your_Project/.github/workflows/main.yml`
1214
```yml
1315
on: push
1416
name: Publish Website
@@ -28,7 +30,10 @@ jobs:
2830
ftp-password: ${{ secrets.FTP_PASSWORD }}
2931
```
3032
31-
#### Setup Steps
33+
---
34+
35+
### Setup Steps
36+
3237
1. Select the repository you want to add the action to
3338
2. Select the `Actions` tab
3439
3. 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`
@@ -38,8 +43,12 @@ jobs:
3843

3944
__Note: Only tracked files will be published by default. If you want to publish files that don't exist in github (example: files generated during the action run) you must add those files/folders to `.git-ftp-include`__
4045

46+
Migrating from v2? See the [migration guide](v2-v3-migration.md)
47+
48+
---
49+
4150
### Settings
42-
**Migrating from v2? See the [migration guide](v2-v3-migration.md)**
51+
4352

4453
Keys can be added directly to your .yml config file or referenced from your project `Secrets` storage.
4554

@@ -151,7 +160,10 @@ vendor/:composer.lock
151160
```
152161
But keep in mind that this will upload all files in the vendor folder, even those that are on the server already. And it will not delete files from that directory if local files are deleted.
153162

154-
### Common Examples
163+
---
164+
165+
# Common Examples
166+
155167
Read more about the differences between these protocols [https://www.sftp.net/sftp-vs-ftps](https://www.sftp.net/sftp-vs-ftps)
156168

157169
### FTP (File Transfer Protocol)
@@ -255,7 +267,6 @@ jobs:
255267
git-ftp-args: --insecure # if your certificate is setup correctly this can be removed (see known-hosts argument)
256268
```
257269

258-
259270
### Build and Publish React/Angular/Vue Website
260271
Make sure you have an npm script named 'build'. This config should work for most node built websites.
261272

@@ -318,33 +329,95 @@ jobs:
318329
git-ftp-args: --dry-run
319330
```
320331

321-
##### Want another example? Let me know by creating a github issue
332+
_Want another example? Let me know by creating a github issue_
333+
334+
---
322335

323336
## FAQ
324-
1. `Can't access remote 'sftp://', exiting...` or `Can't access remote 'ftps://', exiting...`
337+
<details>
338+
<summary>How to exclude .git files from the publish</summary>
339+
340+
See the [`.git-ftp-ignore`](#ignore-specific-files-when-deploying) example section
341+
</details>
342+
343+
<details>
344+
<summary>All files are being uploaded instead of just different files</summary>
345+
346+
By default only different files are uploaded.
347+
348+
Verify you have `with: fetch-depth: 2` in your `actions/checkout@master` step. The last 2 checkins are required in order to determine differences
349+
350+
If you've had multiple git commits without deploying, all files will be uploaded to get back in sync
351+
352+
Verify you **don't** have the `--all` git-ftp-args flag set
353+
</details>
354+
355+
<details>
356+
<summary>How do I set a upload timeout?</summary>
357+
358+
github has a built-in `timeout-minutes` option, see customized example below
359+
360+
```yaml
361+
on: push
362+
name: Publish Website
363+
jobs:
364+
FTP-Deploy-Action:
365+
name: FTP-Deploy-Action
366+
runs-on: ubuntu-latest
367+
timeout-minutes: 15 # time out after 15 minutes (default is 360 minutes)
368+
steps:
369+
....
370+
```
371+
</details>
372+
373+
---
374+
375+
## Common Errors
376+
<details id="failed-to-upload">
377+
<summary>Failed to upload files</summary>
378+
325379
* **Fix 1:** Verify your login credentials are correct, download a ftp client and test with the exact same host/username/password
326380
* **Fix 2:** Remember if you are using SFTP or FTPS you cannot use a normal FTP account username/password. You must use a elevated account. Each host has a different process to setup a FTPS or SFTP account. Please contact your host for help.
327381
* **Fix 3:** If you are using sftp or ftps you should add `git-ftp-args: --insecure`, most hosts setup certificates incorrectly :(
328-
2. My files aren't uploading
329-
* V3+ uses github to determine when files have changes and only publish differences. This means files that aren't committed to github will not upload by default. To change this behavior please see `.git-ftp-include` documentation
330-
3. `rm: Access failed: 553 Prohibited file name: ./.ftpquota`
331-
* **What is happening?** The `.ftpquota` file is created by some FTP Servers and cannot be modified by the user
332-
* **Fix:** Add `.ftpquota` to your `.git-ftp-ignore` file
333-
4. How to exclude .git files from the publish
334-
* **Fix:** See the `.git-ftp-ignore` example above
335-
5. All files are being uploaded instead of just different files
336-
* By default only different files are uploaded.
337-
* Verify you have `with: fetch-depth: 2` in your `actions/checkout@master` step. The last 2 checkins are required in order to determine differences
338-
* If you've had multiple git commits without deploying, all files will be uploaded to get back in sync
339-
* Verify you **don't** have the `--all` git-ftp-args flag set
340-
6. How do I set a upload timeout?
341-
* github has a built-in `timeout-minutes` option. Place `timeout-minutes: X` before the `steps:` line. Timeout defaults to 360 minutes.
342-
7. If you are getting a curl error similar to `SSL peer certificate or SSH remote key was not OK`
343-
* **Fix 1:** Whitelist your host via the `known-hosts` configuration option. See [known hosts setup](#known-hosts-setup) in SFTP
344-
* **Fix 2:** Add `--insecure` option
345-
346-
347-
### Debugging locally
382+
</details>
383+
384+
<details id="cant-access-remote-sftp">
385+
<summary>Can't access remote 'sftp://', exiting...</summary>
386+
387+
See **"Failed to upload files"** section above
388+
</details>
389+
390+
<details id="cant-access-remote-ftps">
391+
<summary>Can't access remote 'ftps://', exiting...</summary>
392+
393+
See **"Failed to upload files"** section above
394+
</details>
395+
396+
<details id="files-arent_uploading">
397+
<summary>My files aren't uploading</summary>
398+
399+
V3+ uses github to determine when files have changes and only publish differences. This means files that aren't committed to github will not upload by default.
400+
401+
To change this behavior please see [`.git-ftp-ignore`](#ignore-specific-files-when-deploying) documentation.
402+
</details>
403+
404+
<details id="prohibited-file-name">
405+
<summary>rm: Access failed: 553 Prohibited file name: ./.ftpquota</summary>
406+
407+
The `.ftpquota` file is created by some FTP Servers and cannot be modified by the user
408+
409+
Add `.ftpquota` to your [`.git-ftp-ignore`](#ignore-specific-files-when-deploying) file
410+
</details>
411+
412+
<details id="ssl-peer-certificate">
413+
<summary>Error: SSL peer certificate or SSH remote key was not OK</summary>
414+
415+
Whitelist your host via the `known-hosts` configuration option (see [known hosts setup](#known-hosts-setup) in SFTP) or add the `--insecure` argument
416+
</details>
417+
418+
---
419+
420+
## Debugging locally
348421
##### Instructions for debugging on windows
349422
- Install docker for windows
350423
- Open powershell

images/action-preview.gif

-85.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)