Skip to content

Commit 79d1755

Browse files
committed
v1.0.0
1 parent b4e9937 commit 79d1755

File tree

13 files changed

+10605
-1975
lines changed

13 files changed

+10605
-1975
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release Drafter
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
update_release_draft:
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: release-drafter/release-drafter@v5
20+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
21+
# with:
22+
# config-name: my-config.yml
23+
# disable-autolabeler: true
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
with:
28+
name-template: "v$RESOLVED_VERSION"
29+
tag-template: "v$RESOLVED_VERSION"
30+
categories:
31+
- title: "Web Deploy v$RESOLVED_VERSION"
32+
labels:
33+
- "feature"
34+
- "enhancement"
35+
- title: "🐛 Bug Fixes"
36+
labels:
37+
- "fix"
38+
- "bugfix"
39+
- "bug"
40+
- title: "🧰 Maintenance"
41+
label: "chore"
42+
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
43+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
44+
version-resolver:
45+
major:
46+
labels:
47+
- "major"
48+
minor:
49+
labels:
50+
- "minor"
51+
patch:
52+
labels:
53+
- "patch"
54+
default: patch
55+
template: |
56+
## Changes
57+
58+
$CHANGES

.github/workflows/test-report.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "tests"
2+
on:
3+
pull_request:
4+
push:
5+
jobs:
6+
build-test:
7+
name: Build & Test
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 18
14+
cache: "npm"
15+
- run: npm ci
16+
- run: npm run test-ci
17+
18+
- name: Test Report
19+
uses: dorny/test-reporter@v1
20+
if: success() || failure()
21+
with:
22+
name: JEST Tests
23+
path: reports/jest-*.xml
24+
reporter: jest-junit

.github/workflows/test-rsync-deploy.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
__tests__/runner/*
2+
reports/
23

34
# comment out in distribution branches
45
node_modules/

README.md

Lines changed: 80 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:
2-
### This package has not been released yet. Feel free to test it out but at your own risk
3-
:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:
4-
51
<p align="center">
62
<img alt="web deploy - Continuous integration for everyone" src="images/web-deploy-logo-small.png">
73
</p>
84

9-
Automate deploying websites and more with this GitHub action
5+
Automate deploying websites and more with this GitHub action. **It's free!**
106

117
![Test web deploy](https://github.com/SamKirkland/web-deploy/workflows/Test%20web%20deploy/badge.svg)
128

@@ -23,14 +19,18 @@ jobs:
2319
runs-on: ubuntu-latest
2420
steps:
2521
- name: 🚚 Get latest code
26-
uses: actions/checkout@v2.1.0
22+
uses: actions/checkout@v3
2723

2824
- name: 📂 Sync files
29-
uses: SamKirkland/web-deploy@1.0.0
25+
uses: SamKirkland/web-deploy@v1.0.0
3026
with:
3127
target-server: samkirkland.com
32-
remote-user: myFtpUserName
33-
remote-key: ${{ secrets.SSH_KEY }}
28+
username: myFtpUserName
29+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
30+
args:
31+
local-dir:
32+
server-dir:
33+
exclude:
3434
```
3535
3636
---
@@ -60,33 +60,36 @@ Keys can be added directly to your .yml config file or referenced from your proj
6060
To add a `secret` go to the `Settings` tab in your project then select `Secrets`.
6161
I strongly recommend you store your `remote-key` as a secret.
6262

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 --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 |
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 |
7171

7272
#### Advanced options using `rsync-options`
7373
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.
7474
You can use as many arguments as you want, seperate them with a space
7575

7676
Below is an incomplete list of commonly used args:
7777

78-
| Option | Description |
79-
|------------------------|------------------------------------------------------------------------------------------------------------------|
80-
| `--dry-run` | Does not upload or delete anything, but tells you what it would upload/delete if this was a real deploy |
81-
| `--stats` | Print verbose statistics on the file transfer, allowing you to tell how effective rsync’s delta-transfer algorithm is for your data |
82-
| `--links` | When symlinks are encountered, recreate the symlink on the destination |
83-
| `--compress` | Compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted |
84-
| `--human-readable` | Output bytes in a more human-readable format (K, M, G) |
85-
| `--delete` | When you delete a file on github it will also be deleted on the server |
86-
| `--max-size '200K'` | Ignore syncing files over this limit. Value is a number followed by "K", "M", or "G" |
87-
| `--exclude 'file.txt'` | Excludes file(s) from the deployment. Supports glob pattterns (ex: `*.jpg`). You can have multiple excludes! |
88-
| `--include 'file.txt'` | Includes file(s) even if it was excluded. Supports glob pattterns (ex: `*.jpg`). You can have multiple includes! |
89-
78+
| Option | Description |
79+
|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
80+
| `--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
9093

9194
# Common Examples
9295
#### Build and Publish React/Angular/Vue Website
@@ -97,24 +100,24 @@ on: push
97100
name: Publish Website
98101
jobs:
99102
web-deploy:
100-
name: 🚀 Deploy website every commit
103+
name: 🚀 Deploy Website Every Commit
101104
runs-on: ubuntu-latest
102105
steps:
103-
- name: 🚚 Get latest code
104-
uses: actions/checkout@v2.1.0
106+
- name: 🚚 Get Latest Code
107+
uses: actions/checkout@v3
105108
106-
- name: Use Node.js 12.x
107-
uses: actions/setup-node@v1
109+
- name: 📦 Install Packages
110+
- uses: actions/setup-node@v3
108111
with:
109-
node-version: '12.x'
112+
node-version: 18
113+
cache: "npm"
114+
- run: npm ci
110115
111-
- name: 🔨 Build Project
112-
run: |
113-
npm install
114-
npm run build
116+
- name: 🔨 Build
117+
run: npm run build
115118
116-
- name: 📂 Sync files
117-
uses: SamKirkland/web-deploy@1.0.0
119+
- name: 📂 Sync Files
120+
uses: SamKirkland/web-deploy@v1.0.0
118121
with:
119122
target-server: samkirkland.com
120123
remote-user: myFtpUserName
@@ -132,10 +135,10 @@ jobs:
132135
runs-on: ubuntu-latest
133136
steps:
134137
- name: 🚚 Get latest code
135-
uses: actions/checkout@v2.1.0
138+
uses: actions/checkout@v3
136139
137140
- name: 📂 Sync files
138-
uses: SamKirkland/web-deploy@1.0.0
141+
uses: SamKirkland/web-deploy@v1.0.0
139142
with:
140143
ftp-server: samkirkland.com
141144
ftp-username: myFTPUsername
@@ -172,40 +175,47 @@ Example excluding a specific folder:
172175
`rsync-options: --exclude "wp-content/themes/"`
173176
</details>
174177

178+
---
175179

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>
178183

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`.
180187

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.
195+
```yaml
196+
runs-on: [self-hosted, linux, my-self-hosted-runner-label]
189197
steps:
190-
....
191-
```
192-
</details>
198+
- name: Install rsync
199+
run: |
200+
sudo apt-get update
201+
sudo apt-get install rsync
202+
```
203+
204+
On `macos` runners install rsync **before** the `web-deploy` step.
205+
```yaml
206+
runs-on: macos-latest
207+
steps:
208+
- name: Install rsync
209+
run: |
210+
brew update
211+
brew install rsync
212+
```
213+
214+
[Read more about customizing runners](https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners)
193215

194-
---
195216

196-
## Common Errors
197-
<details id="ssl-peer-certificate">
198-
<summary>Error: SSL peer certificate or SSH remote key was not OK</summary>
199217

200-
Whitelist your host via the `known-hosts` configuration option or add the `--insecure` argument
218+
https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners
201219
</details>
202220

203221
---
204-
205-
## Debugging locally
206-
##### Instructions for debugging on windows
207-
- Install docker for windows
208-
- Open powershell
209-
- Navigate to the repo folder
210-
- Run `docker build --tag action .`
211-
- Run `docker run action`

action.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
name: 'web deploy'
2-
description: 'Deploy websites via sftp/ssh'
3-
author: 'Sam Kirkland'
1+
name: "web deploy"
2+
description: "Deploy websites via sftp/ssh"
3+
author: "Sam Kirkland"
44
inputs:
55
target-server:
6-
description: 'eployment 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, when not specified it will default to 22"
77
required: true
88
remote-user:
9-
description: 'SSH account username'
9+
description: "SSH account username"
1010
required: true
1111
remote-key:
12-
description: 'SSH account password'
12+
description: "SSH account password"
1313
required: true
1414
source-path:
15-
description: 'Path to upload to on the server, must end with trailing slash /'
15+
description: "Path to upload to on the server, must end with trailing slash /"
1616
required: true
1717
destination-path:
18-
description: 'Folder to upload from, must end with trailing slash /'
18+
description: "Folder to upload from, must end with trailing slash /"
1919
required: true
20+
ssh-port:
21+
description: "Port for SSH"
22+
default: "22"
23+
required: false
2024
rsync-options:
21-
description: 'Passes through options into rsync'
22-
default:
25+
description: "Passes through options into rsync"
26+
default: "--archive --verbose --compress --human-readable --progress --delete-after --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore"
2327
required: false
2428
runs:
25-
using: 'node12'
26-
main: 'dist/index.js'
29+
using: "node12"
30+
main: "dist/index.js"
2731
branding:
28-
icon: 'upload-cloud'
29-
color: 'blue'
32+
icon: "upload-cloud"
33+
color: "blue"

0 commit comments

Comments
 (0)