Skip to content

Commit bc9a5b3

Browse files
committed
readme
1 parent b1dc69a commit bc9a5b3

File tree

6 files changed

+42
-41
lines changed

6 files changed

+42
-41
lines changed

README.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@ on: push
1515
name: Publish Website
1616
jobs:
1717
web-deploy:
18-
name: 🚀 Deploy website every commit
18+
name: 🚀 Deploy Website Every Commit
1919
runs-on: ubuntu-latest
2020
steps:
21-
- name: 🚚 Get latest code
21+
- name: 🚚 Get Latest Code
2222
uses: actions/checkout@v3
2323

24-
- name: 📂 Sync files
25-
uses: SamKirkland/web-deploy@v1.0.0
24+
- name: 📂 Sync Files
25+
uses: SamKirkland/web-deploy@v1
2626
with:
27-
target-server: samkirkland.com
28-
username: myFtpUserName
29-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
30-
args:
31-
local-dir:
32-
server-dir:
33-
exclude:
27+
target-server: example.com
28+
remote-user: username
29+
remote-key: ${{ secrets.SSH_KEY }}
30+
destination-path: ~/destinationFolder/
3431
```
3532
3633
---
@@ -60,14 +57,15 @@ Keys can be added directly to your .yml config file or referenced from your proj
6057
To add a `secret` go to the `Settings` tab in your project then select `Secrets`.
6158
I strongly recommend you store your `remote-key` as a secret.
6259

63-
| Key Name | Required? | Example | Default | Description |
64-
|--------------------|-----------|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
65-
| `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 |
67-
| `remote-key` | Yes | `CrazyUniquePassword&%123` | | SSH private key |
68-
| `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 |
60+
| Key Name | Required? | Example | Default | Description |
61+
|--------------------|-----------|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
62+
| `target-server` | Yes | `example.com` | | Destination server to deploy to |
63+
| `destination-path` | Yes | `~/folderOnServerThatAlreadyExists/` | | Path on the server to deploy to. Must already exist. |
64+
| `remote-user` | Yes | `username` | | SSH user to login as |
65+
| `private-ssh-key` | Yes | `-----BEGIN RSA PRIVATE KEY----- ......` | | SSH Private key. Must be specified as a secret. |
66+
| `source-path` | No | `./myFolderToPublish/` | `./` | Path to upload to on the server, must end with trailing slash `/` |
67+
| `ssh-port` | No | `12345` | `22` | SSH port to use. Most hosts change this from the default. This is NOT your websites port. |
68+
| `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. |
7169

7270
#### Advanced options using `rsync-options`
7371
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.
@@ -117,11 +115,12 @@ jobs:
117115
run: npm run build
118116
119117
- name: 📂 Sync Files
120-
uses: SamKirkland/web-deploy@v1.0.0
118+
uses: SamKirkland/web-deploy@v1
121119
with:
122-
target-server: samkirkland.com
123-
remote-user: myFtpUserName
120+
target-server: example.com
121+
remote-user: username
124122
remote-key: ${{ secrets.SSH_KEY }}
123+
destination-path: ~/destinationFolder/
125124
```
126125

127126
#### Log only dry run: Use this mode for testing
@@ -131,19 +130,21 @@ on: push
131130
name: Publish Website Dry Run
132131
jobs:
133132
web-deploy:
134-
name: 🚀 Deploy website every commit
133+
name: 🚀 Deploy Website Every Commit
135134
runs-on: ubuntu-latest
136135
steps:
137-
- name: 🚚 Get latest code
136+
- name: 🚚 Get Latest Code
138137
uses: actions/checkout@v3
139138
140-
- name: 📂 Sync files
141-
uses: SamKirkland/web-deploy@v1.0.0
139+
- name: 📂 Sync Files
140+
uses: SamKirkland/web-deploy@v1
142141
with:
143-
ftp-server: samkirkland.com
144-
ftp-username: myFTPUsername
145-
ftp-password: ${{ secrets.FTP_PASSWORD }}
146-
git-ftp-args: --dry-run
142+
target-server: example.com
143+
remote-user: username
144+
remote-key: ${{ secrets.SSH_KEY }}
145+
ssh-port: 22
146+
destination-path: ~/destinationFolder/
147+
rsync-options: --dry-run --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore
147148
```
148149

149150
_Want another example? Let me know by creating a [github issue](https://github.com/SamKirkland/web-deploy/issues/new)_

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: "web deploy"
2-
description: "Deploy websites via sftp/ssh"
2+
description: "Deploy websites via sftp/ssh/rsync"
33
author: "Sam Kirkland"
44
inputs:
55
target-server:
6-
description: "Deployment destination server. Formatted as domain.com:port. Port is optional, when not specified it will default to 22"
6+
description: "Deployment destination server. Formatted as domain.com:port. Port is optional and is your websites port, not your SSH port"
77
required: true
88
remote-user:
99
description: "SSH account username"
1010
required: true
11-
remote-key:
12-
description: "SSH account password"
11+
private-ssh-key:
12+
description: "Private SSH key"
1313
required: true
1414
source-path:
1515
description: "Path to upload to on the server, must end with trailing slash /"
@@ -30,4 +30,4 @@ runs:
3030
main: "dist/index.js"
3131
branding:
3232
icon: "upload-cloud"
33-
color: "blue"
33+
color: "green"

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3438,7 +3438,7 @@ async function run() {
34383438
try {
34393439
const userArguments = getUserArguments();
34403440
await verifyRsyncInstalled();
3441-
const privateKeyPath = await setupSSHPrivateKey(userArguments.remote_key);
3441+
const privateKeyPath = await setupSSHPrivateKey(userArguments.private_ssh_key);
34423442
await syncFiles(privateKeyPath, userArguments);
34433443
console.log("\u2705 Deploy Complete");
34443444
} catch (error) {
@@ -3452,7 +3452,7 @@ function getUserArguments() {
34523452
target_server: (0, import_core.getInput)("target-server", { required: true }),
34533453
destination_path: withDefault((0, import_core.getInput)("destination-path", { required: false }), "./"),
34543454
remote_user: (0, import_core.getInput)("remote-user", { required: true }),
3455-
remote_key: (0, import_core.getInput)("remote-key", { required: true }),
3455+
private_ssh_key: (0, import_core.getInput)("private-ssh-key", { required: true }),
34563456
source_path: withDefault((0, import_core.getInput)("source-path", { required: false }), "./"),
34573457
ssh_port: withDefault((0, import_core.getInput)("ssh-port"), "22"),
34583458
rsync_options: withDefault((0, import_core.getInput)("rsync-options"), default_rsync_options)

src/main.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("syncFiles", () => {
1212
source_path: "./sourcePath",
1313
destination_path: "/destFolder/subFolder/",
1414
remote_user: "username",
15-
remote_key: "keyname",
15+
private_ssh_key: "keyname",
1616
ssh_port: "54321",
1717
rsync_options: "--test",
1818
});

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function run() {
1515
const userArguments = getUserArguments();
1616

1717
await verifyRsyncInstalled();
18-
const privateKeyPath = await setupSSHPrivateKey(userArguments.remote_key);
18+
const privateKeyPath = await setupSSHPrivateKey(userArguments.private_ssh_key);
1919
await syncFiles(privateKeyPath, userArguments);
2020

2121
console.log("✅ Deploy Complete");
@@ -33,7 +33,7 @@ function getUserArguments(): IActionArguments {
3333
target_server: getInput("target-server", { required: true }),
3434
destination_path: withDefault(getInput("destination-path", { required: false }), "./"),
3535
remote_user: getInput("remote-user", { required: true }),
36-
remote_key: getInput("remote-key", { required: true }),
36+
private_ssh_key: getInput("private-ssh-key", { required: true }),
3737
source_path: withDefault(getInput("source-path", { required: false }), "./"),
3838
ssh_port: withDefault(getInput("ssh-port"), "22"),
3939
rsync_options: withDefault(getInput("rsync-options"), default_rsync_options)

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export interface IActionArguments {
33
source_path: string | undefined;
44
destination_path: string;
55
remote_user: string;
6-
remote_key: string;
6+
private_ssh_key: string;
77

88
ssh_port: string;
99
rsync_options: string;

0 commit comments

Comments
 (0)