mirror of
https://github.com/SamKirkland/FTP-Deploy-Action.git
synced 2026-04-10 12:32:17 +02:00
Compare commits
2 Commits
v3.1.1-pat
...
v3.1.0-pat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e81b13788 | ||
|
|
50505ea27c |
36
README.md
36
README.md
@@ -23,7 +23,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
- name: FTP-Deploy-Action
|
- name: FTP-Deploy-Action
|
||||||
uses: SamKirkland/FTP-Deploy-Action@3.1.1
|
uses: SamKirkland/FTP-Deploy-Action@3.1.0
|
||||||
with:
|
with:
|
||||||
ftp-server: ftp://ftp.samkirkland.com/
|
ftp-server: ftp://ftp.samkirkland.com/
|
||||||
ftp-username: myFtpUserName
|
ftp-username: myFtpUserName
|
||||||
@@ -183,7 +183,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
- name: FTP-Deploy-Action
|
- name: FTP-Deploy-Action
|
||||||
uses: SamKirkland/FTP-Deploy-Action@3.1.1
|
uses: SamKirkland/FTP-Deploy-Action@3.1.0
|
||||||
with:
|
with:
|
||||||
ftp-server: ftp://ftp.samkirkland.com/
|
ftp-server: ftp://ftp.samkirkland.com/
|
||||||
ftp-username: myFtpUserName
|
ftp-username: myFtpUserName
|
||||||
@@ -212,7 +212,7 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: FTP-Deploy-Action
|
- name: FTP-Deploy-Action
|
||||||
uses: SamKirkland/FTP-Deploy-Action@3.1.1
|
uses: SamKirkland/FTP-Deploy-Action@3.1.0
|
||||||
with:
|
with:
|
||||||
ftp-server: ftps://ftp.samkirkland.com:21/
|
ftp-server: ftps://ftp.samkirkland.com:21/
|
||||||
ftp-username: myFTPSUsername
|
ftp-username: myFTPSUsername
|
||||||
@@ -259,7 +259,7 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: FTP-Deploy-Action
|
- name: FTP-Deploy-Action
|
||||||
uses: SamKirkland/FTP-Deploy-Action@3.1.1
|
uses: SamKirkland/FTP-Deploy-Action@3.1.0
|
||||||
with:
|
with:
|
||||||
ftp-server: sftp://ftp.samkirkland.com:7280/
|
ftp-server: sftp://ftp.samkirkland.com:7280/
|
||||||
ftp-username: mySFTPUsername
|
ftp-username: mySFTPUsername
|
||||||
@@ -298,7 +298,7 @@ jobs:
|
|||||||
run: ls
|
run: ls
|
||||||
|
|
||||||
- name: FTP-Deploy-Action
|
- name: FTP-Deploy-Action
|
||||||
uses: SamKirkland/FTP-Deploy-Action@3.1.1
|
uses: SamKirkland/FTP-Deploy-Action@3.1.0
|
||||||
with:
|
with:
|
||||||
ftp-server: ftp://ftp.samkirkland.com/
|
ftp-server: ftp://ftp.samkirkland.com/
|
||||||
ftp-username: myFTPUsername
|
ftp-username: myFTPUsername
|
||||||
@@ -321,7 +321,7 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: FTP-Deploy-Action
|
- name: FTP-Deploy-Action
|
||||||
uses: SamKirkland/FTP-Deploy-Action@3.1.1
|
uses: SamKirkland/FTP-Deploy-Action@3.1.0
|
||||||
with:
|
with:
|
||||||
ftp-server: ftp://ftp.samkirkland.com/
|
ftp-server: ftp://ftp.samkirkland.com/
|
||||||
ftp-username: myFTPUsername
|
ftp-username: myFTPUsername
|
||||||
@@ -418,24 +418,14 @@ jobs:
|
|||||||
---
|
---
|
||||||
|
|
||||||
## Debugging locally
|
## Debugging locally
|
||||||
##### Instructions for debugging Windows
|
##### Instructions for debugging on windows
|
||||||
- [Install docker](https://docs.docker.com/get-docker/)
|
- Install docker for windows
|
||||||
- Open powershell **as Administrator**
|
- Open powershell
|
||||||
- Install [act-cli](https://github.com/nektos/act#installation) by running `choco install act-cli`
|
|
||||||
- Navigate to the repo folder
|
- Navigate to the repo folder
|
||||||
- Run `npm install` - this will install all dependencies to build this project
|
- Run `docker build --tag action .`
|
||||||
- Run `npm build` - this will build the action javascript and watch/rebuild when files change
|
- Run `docker run action`
|
||||||
- Run `npm run build-docker` - this will build the docker container (only needs to be done once)
|
|
||||||
- Run `npm run run-docker` - this will spin up a local copy of the action defined in `/debug/local-debug-deployment.yaml`. Update package.json to set any secret values
|
|
||||||
|
|
||||||
#### Instructions for debugging on Linux
|
##### Instructions for debugging on linux
|
||||||
- [Install docker](https://docs.docker.com/get-docker/) on a Debian-based distro you can run `sudo apt install docker docker.io`
|
- Please submit a PR for linux instructions :)
|
||||||
- Open the terminal
|
|
||||||
- Install [act-cli](https://github.com/nektos/act#installation)
|
|
||||||
- Navigate to the repo folder
|
|
||||||
- Run `npm install` - this will install all dependencies to build this project
|
|
||||||
- Run `npm build` - this will build the action javascript and watch/rebuild when files change
|
|
||||||
- Run `npm run build-docker` - this will build the docker container (only needs to be done once)
|
|
||||||
- Run `npm run run-docker` - this will spin up a local copy of the action defined in `/debug/local-debug-deployment.yaml`. Update package.json to set any secret values
|
|
||||||
|
|
||||||
#### Pull Requests Welcome!
|
#### Pull Requests Welcome!
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
on: push
|
|
||||||
name: Local Debug Deployment
|
|
||||||
jobs:
|
|
||||||
Local-Debug-Deployment:
|
|
||||||
name: Local-Debug-Deployment
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.1.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: FTP-Deploy-Action
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
ftp-server: ftp://ftp.samkirkland.com/
|
|
||||||
ftp-username: ${{ secrets.username }}
|
|
||||||
ftp-password: ${{ secrets.password }}
|
|
||||||
git-ftp-args: --dry-run
|
|
||||||
12
dist/index.js
vendored
12
dist/index.js
vendored
@@ -1049,19 +1049,11 @@ function syncFiles(args) {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
yield core.group("Uploading files", () => __awaiter(this, void 0, void 0, function* () {
|
yield core.group("Uploading files", () => __awaiter(this, void 0, void 0, function* () {
|
||||||
return yield exec.exec("git ftp push", [
|
return yield exec.exec(`git ftp push --force --auto-init --verbose --syncroot ${args.local_dir} --user ${args.ftp_username} --passwd ${args.ftp_password} ${args.gitFtpArgs} ${args.ftp_server}`);
|
||||||
"--force",
|
|
||||||
"--auto-init",
|
|
||||||
"--verbose",
|
|
||||||
`--syncroot=${args.local_dir}`,
|
|
||||||
`--user=${args.ftp_username}`,
|
|
||||||
`--passwd=${args.ftp_password}`,
|
|
||||||
args.gitFtpArgs,
|
|
||||||
args.ftp_server
|
|
||||||
]);
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error("⚠️ Failed to upload files");
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,9 +8,10 @@
|
|||||||
"node": ">=12.0.0"
|
"node": ">=12.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build src/main.ts -o dist --watch",
|
"build:dev": "tsc",
|
||||||
"build-docker": "docker build --tag action .",
|
"build:production": "ncc build src/main.ts -o dist",
|
||||||
"run-docker": "act --workflows ./debug/ --secret username=UserNameHere --secret password=PasswordHere"
|
"build:docker": "docker build --tag action .",
|
||||||
|
"run:docker": "docker run action --build-arg FTP_SERVER=example.com FTP_USERNAME=test@example.com FTP_PASSWORD=passwordExample"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
15
src/main.ts
15
src/main.ts
@@ -70,22 +70,11 @@ function withDefault(value: string, defaultValue: string) {
|
|||||||
async function syncFiles(args: IActionArguments) {
|
async function syncFiles(args: IActionArguments) {
|
||||||
try {
|
try {
|
||||||
await core.group("Uploading files", async () => {
|
await core.group("Uploading files", async () => {
|
||||||
return await exec.exec(
|
return await exec.exec(`git ftp push --force --auto-init --verbose --syncroot ${args.local_dir} --user ${args.ftp_username} --passwd ${args.ftp_password} ${args.gitFtpArgs} ${args.ftp_server}`);
|
||||||
"git ftp push",
|
|
||||||
[
|
|
||||||
"--force",
|
|
||||||
"--auto-init",
|
|
||||||
"--verbose",
|
|
||||||
`--syncroot=${args.local_dir}`,
|
|
||||||
`--user=${args.ftp_username}`,
|
|
||||||
`--passwd=${args.ftp_password}`,
|
|
||||||
args.gitFtpArgs!,
|
|
||||||
args.ftp_server!
|
|
||||||
]
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error("⚠️ Failed to upload files");
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ export enum gitFTPExitCode {
|
|||||||
ErrorWhileDownloading = 5,
|
ErrorWhileDownloading = 5,
|
||||||
UnknownProtocol = 6,
|
UnknownProtocol = 6,
|
||||||
RemoteLocked = 7,
|
RemoteLocked = 7,
|
||||||
GitRelatedError = 8,
|
NotAGitProject = 8,
|
||||||
PreFTPPushHookFailed = 9,
|
PreFTPPushHookFailed = 9,
|
||||||
LocalFileOperationFailed = 10
|
LocalFileOperationFailed = 10
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user