Compare commits

..

No commits in common. "master" and "v4.3.0" have entirely different histories.

10 changed files with 5064 additions and 5255 deletions

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: 📂 Sync files
uses: ./

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: 📂 Sync files
uses: ./

View File

@ -20,10 +20,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
uses: SamKirkland/FTP-Deploy-Action@4.3.0
with:
server: ftp.samkirkland.com
username: myFtpUserName
@ -33,7 +33,7 @@ jobs:
---
### Requirements
- 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
- You must have ftp access to your server. If your host requires ssh please use my web-deploy action (coming soon)
- Some web hosts change the default port (21), check with your host for your port number
---
@ -67,10 +67,9 @@ I strongly recommend you store your `password` as a secret.
| `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 |
| `dry-run` | No | `true` | `false` | Prints which modifications will be made with current config options, but doesn't actually make any changes |
| `dangerous-clean-slate` | No | `true` | `false` | Deletes ALL contents of server-dir, even items in excluded with 'exclude' argument |
| `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&glob=%2A%2A%2F.git%2A%2F%2A%2A&matches=false&tests=test%2Fsam&tests=.git%2F%0D&tests=.github%2F%0D&tests=.git%2Ftest%0D&tests=.gitattributes%0D&tests=.gitignore%0D&tests=.git%2Fconfig%0D&tests=.git%2Ftest%2Ftest&tests=.github%2Fworkflows%2Fmain.yml&tests=node_modules%2Ffolder%2F%0D&tests=node_modules%2Fotherfolder%2F%0D&tests=subfolder%2Fnode_modules%2F) to test your pattern(s). |
| `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&glob=%2A%2A%2F.git%2A%2F%2A%2A&matches=false&tests=test%2Fsam&tests=.git%2F&tests=.github%2F&tests=.git%2Ftest&tests=.gitattributes&tests=.gitignore&tests=.git%2Fconfig&tests=.git%2Ftest%2Ftest&tests=.github%2Fworkflows%2Fmain.yml&tests=test%2F.git%2Fworkflows%2Fmain.yml&tests=node_modules%2Ffolder%2F&tests=node_modules%2Fotherfolder%2F&tests=subfolder%2Fnode_modules%2F) to test your pattern(s). |
| `log-level` | No | `minimal` | `standard` | `minimal`: only important info, `standard`: important info and basic file changes, `verbose`: print everything the script is doing |
| `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 |
| `timeout` | No | `60000` | `30000` | Timeout in milliseconds for FTP operations |
# Common Examples
@ -86,12 +85,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Use Node.js 16
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '14'
- name: 🔨 Build Project
run: |
@ -99,7 +98,7 @@ jobs:
npm run build
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
uses: SamKirkland/FTP-Deploy-Action@4.3.0
with:
server: ftp.samkirkland.com
username: myFtpUserName
@ -116,10 +115,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
uses: SamKirkland/FTP-Deploy-Action@4.3.0
with:
server: ftp.samkirkland.com
username: myFtpUserName
@ -139,10 +138,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
uses: SamKirkland/FTP-Deploy-Action@4.3.0
with:
server: ftp.samkirkland.com
username: myFtpUserName
@ -161,10 +160,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
uses: SamKirkland/FTP-Deploy-Action@4.3.0
with:
server: ftp.samkirkland.com
username: myFtpUserName

View File

@ -41,12 +41,9 @@ inputs:
security:
required: false
description: "strict or loose"
timeout:
required: false
description: "Timeout in milliseconds for FTP operations"
runs:
using: "node20"
using: "node12"
main: "dist/index.js"
branding:
icon: "upload-cloud"
color: "blue"
color: "orange"

2208
dist/index.js vendored

File diff suppressed because it is too large Load Diff

3
jest.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
preset: "ts-jest"
};

View File

@ -1,9 +1,8 @@
# How to migrate between versions
# Migrating from v4.1.0 to v4.2.0
## Migrating from v4.1.0 to v4.2.0
`v4.2.0` parses the `exclude` option in a more standard way. Going forward the `exclude` option **must** be in the following format:
`v4.2.0` parses the `exclude` option in a more standard way.
Going forward the `exclude` option **must** be in the following format
```yml
exclude: |
**/.git*
@ -12,29 +11,28 @@ exclude: |
fileToExclude.txt
```
## Migrating from v3 to v4
---
# Migrating from v3 to v4
Migrating from v3 to v4 should be fairly straightforward. Version 4 was designed with speed and ease of initial setup in mind. Going forward version 4 will be the only supported version.
### Those who can't upgrade
Most features have been carried forward and improved upon. However, some features did not make the cut:
#### Those who can't upgrade
Most features have been carried forward and improved upon. However, some features did not make the cut.
- **`sftp` is no longer supported**. If you have `sftp` access you are using `ssh`, that means you have access to a much more modern and capable protocol. I plan on releasing a separate github action that will deploy over `sftp`/`ssh` using `rsync`. Until then you can continue using version 3.
- The `include` argument has been removed. I didn't see much need for it in the initial release. If you need this feature please create a support ticket.
---
### How to upgrade
1. Remove `with: fetch-depth: 2`. It is no longer needed and removing it will _slightly_ speed up deployments.
2. Change the version to `v4.X.X`, for example `SamKirkland/FTP-Deploy-Action@v4.3.5` (please check the [README](https://github.com/SamKirkland/FTP-Deploy-Action/blob/master/README.md) or the [releases page](https://github.com/SamKirkland/FTP-Deploy-Action/releases/latest) for the latest version).
3. If you have a `.git-ftp-include` file you should delete it. Version 4 tracks files differently and no longer needs this config file.
4. If you have a `.git-ftp-ignore` file, you should transfer the options to the new `exclude` argument. **Note:** version 4 excludes any `.git*` and `node_modules/` files / folders by default.
5. Update your arguments to reflect the following changes:
- `ftp-server` was split into 4 arguments:
- `server`
- `port`
- `protocol`
- `server-dir`
- `ftp-username` was renamed to `username`.
- `ftp-password` was renamed to `password`.
- `local-dir` and `server-dir` now **must** end with `/`.
- `git-ftp-args` and `known-hosts` arguments were removed.
1) Remove `with: fetch-depth: 2`. It is no longer needed and removing it will _slightly_ speed up deployments.
2) Change the version to `4.X.X`, for example `SamKirkland/FTP-Deploy-Action@4.1.0` (please check readme for latest version)
3) If you have a `.git-ftp-include` file you should delete it. Version 4 tracks files differently and no longer needs this config file.
4) If you have a `.git-ftp-ignore` file, you should transfer the options to the new `exclude` argument. _Note: Version 4 excludes any `.git*` and `node_modules/` files/folders by default_
5) Update your arguments to reflect the following changes
* `ftp-server` was split into 4 arguments. `server`, `port`, `protocol`, and `server-dir`. Transfer your config to these options as needed.
* `ftp-username` was renamed to `username`
* `ftp-password` was renamed to `password`
* `local-dir` and `server-dir` now **must** end with `/`
* `git-ftp-args` and `known-hosts` arguments were removed

7992
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "ftp-deploy-action",
"version": "4.3.5",
"version": "4.3.0",
"private": true,
"description": "Automate deploying websites and more with this GitHub action",
"main": "dist/index.js",
@ -22,23 +22,20 @@
"author": "Sam Kirkland",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.9.1",
"@samkirkland/ftp-deploy": "^1.2.4",
"@types/jest": "^29.4.1",
"jest": "^29.5.0",
"ts-jest": "^29.0.5",
"ts-node-dev": "^2.0.0"
"@actions/core": "^1.6.0",
"@samkirkland/ftp-deploy": "^1.2.1",
"@types/jest": "^27.0.2",
"jest": "^27.2.5",
"ts-jest": "^27.0.5",
"ts-node-dev": "^1.1.8"
},
"devDependencies": {
"@types/node": "^20.11.24",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"@vercel/ncc": "^0.34.0",
"eslint": "^8.22.0",
"eslint-plugin-jest": "^26.8.7",
"typescript": "^4.7.4"
},
"jest": {
"preset": "ts-jest"
"@types/node": "^14.0.27",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.33.0",
"@vercel/ncc": "^0.31.1",
"eslint": "^7.29.0",
"eslint-plugin-jest": "^24.3.6",
"typescript": "^4.4.3"
}
}

View File

@ -18,8 +18,7 @@ async function runDeployment() {
"dangerous-clean-slate": optionalBoolean("dangerous-clean-slate", core.getInput("dangerous-clean-slate")),
"exclude": optionalStringArray("exclude", core.getMultilineInput("exclude")),
"log-level": optionalLogLevel("log-level", core.getInput("log-level")),
"security": optionalSecurity("security", core.getInput("security")),
"timeout": optionalInt("timeout", core.getInput("timeout"))
"security": optionalSecurity("security", core.getInput("security"))
};
await deploy(args);