Skip to content

Commit 26b851d

Browse files
authored
Merge pull request #1 from FlowSahl/feat/refactor-to-typescript
Feat : Refactor to typescript and enhance code
2 parents 16a89d1 + 211148e commit 26b851d

File tree

9 files changed

+488
-255
lines changed

9 files changed

+488
-255
lines changed

.env.example

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
NODE_ENV=local
2+
3+
HOST=127.0.0.1
4+
REMOTE_USERNAME=website-dev
5+
PORT=22
6+
# PASSWORD=wLsC20XvBjDOPxMt4lJ0
7+
SSH_KEY='-----BEGIN OPENSSH PRIVATE KEY-----
8+
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABB++JZyp
9+
-----END OPENSSH PRIVATE KEY-----'
10+
SSH_PASSPHRASE=password
11+
TARGET=/home/website-dev/htdocs/dev.website.dev
12+
SHA=9f17d06
13+
ENV_FILE='APP_NAME="laravel"
14+
APP_ENV=local
15+
APP_KEY=base64:pz/7scAOjZebfvvtU1TK5JxccE9tZ6VYMFXYWnozSXY=
16+
APP_DEBUG=true
17+
APP_URL="https://dev.laravel.com"
18+
19+
LOG_CHANNEL=daily
20+
LOG_DEPRECATIONS_CHANNEL=null
21+
LOG_LEVEL=debug
22+
23+
DB_CONNECTION=mysql
24+
DB_HOST="localhost"
25+
DB_PORT=3306
26+
DB_DATABASE="laravel-dev"
27+
DB_USERNAME="laravel-dev"
28+
DB_PASSWORD="password"
29+
30+
BROADCAST_DRIVER=log
31+
CACHE_DRIVER=file
32+
FILESYSTEM_DISK=local
33+
QUEUE_CONNECTION=sync
34+
SESSION_DRIVER=file
35+
SESSION_LIFETIME=120
36+
37+
MEMCACHED_HOST=127.0.0.1
38+
39+
REDIS_HOST=127.0.0.1
40+
REDIS_PASSWORD=null
41+
REDIS_PORT=6379
42+
43+
MAIL_MAILER=smtp
44+
MAIL_HOST=mailpit
45+
MAIL_PORT=1025
46+
MAIL_USERNAME=null
47+
MAIL_PASSWORD=null
48+
MAIL_ENCRYPTION=null
49+
MAIL_FROM_ADDRESS="hello@example.com"
50+
MAIL_FROM_NAME="${APP_NAME}"
51+
52+
AWS_ACCESS_KEY_ID=
53+
AWS_SECRET_ACCESS_KEY=
54+
AWS_DEFAULT_REGION=us-east-1
55+
AWS_BUCKET=
56+
AWS_USE_PATH_STYLE_ENDPOINT=false
57+
58+
PUSHER_APP_ID=
59+
PUSHER_APP_KEY=
60+
PUSHER_APP_SECRET=
61+
PUSHER_HOST=
62+
PUSHER_PORT=443
63+
PUSHER_SCHEME=https
64+
PUSHER_APP_CLUSTER=mt1
65+
66+
VITE_APP_NAME="${APP_NAME}"
67+
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
68+
VITE_PUSHER_HOST="${PUSHER_HOST}"
69+
VITE_PUSHER_PORT="${PUSHER_PORT}"
70+
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
71+
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
72+
APP_TIMEZONE="Europe/Andorra"'
73+
# COMMAND_SCRIPT_BEFORE_CHECK_FOLDERS=your-command
74+
# COMMAND_SCRIPT_AFTER_CHECK_FOLDERS=your-command
75+
# COMMAND_SCRIPT_BEFORE_DOWNLOAD=your-command
76+
# COMMAND_SCRIPT_AFTER_DOWNLOAD=your-command
77+
# COMMAND_SCRIPT_BEFORE_ACTIVATE=your-command
78+
# COMMAND_SCRIPT_AFTER_ACTIVATE=your-command
79+
GITHUB_REPO_OWNER=Laravel
80+
GITHUB_REPO=Laravel
81+
GITHUB_DEPLOY_BRANCH=main

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
node_modules/
33
coverage
44
docs
5-
.vscode
5+
.vscode
6+
.env

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5"
6+
}

action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@ inputs:
1717
ssh_key:
1818
description: 'SSH private key to connect server instead use password'
1919
required: false
20+
ssh_passphrase:
21+
description: 'SSH private passphrase'
22+
required: false
2023
target:
2124
description: 'Remote server target path '
2225
required: true
2326
sha:
2427
description: 'Git commit sha need to deploy (github.sha)'
2528
required: true
26-
github_token:
27-
description: 'Github token'
28-
required: true
2929
env_file:
3030
description: 'Environment file content to sync with .env file'
3131
required: false
32+
deploy_branch:
33+
description: 'Branch will deploy from'
34+
required: true
3235

3336

3437
command_script_before_check_folders:

package-lock.json

Lines changed: 25 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "laravel-zero-time",
33
"version": "1.0.0",
44
"description": "Deploy project to server by ssh with zero downtime deployment.",
5-
"main": "src/index.js",
5+
"main": "src/index.ts",
66
"directories": {
77
"test": "test"
88
},
@@ -14,13 +14,16 @@
1414
"node-ssh": "^13.2.0"
1515
},
1616
"devDependencies": {
17+
"@vercel/ncc": "^0.38.1",
1718
"dotenv": "^16.4.5",
1819
"jest": "^29.7.0",
19-
"nock": "^13.5.4"
20+
"nock": "^13.5.4",
21+
"typescript": "^5.5.4"
2022
},
2123
"scripts": {
2224
"test": "jest",
23-
"build": "ncc build src/index.js -m"
25+
"start": "npm run build && node dist/index.js",
26+
"build": "ncc build src/index.ts -o dist --source-map --minify"
2427
},
2528
"repository": {
2629
"type": "git",

0 commit comments

Comments
 (0)