Skip to content

Commit

Permalink
Merge pull request #1 from FlowSahl/feat/refactor-to-typescript
Browse files Browse the repository at this point in the history
Feat : Refactor to typescript and enhance code
  • Loading branch information
TariqAyman authored Aug 11, 2024
2 parents 16a89d1 + 211148e commit 26b851d
Show file tree
Hide file tree
Showing 9 changed files with 488 additions and 255 deletions.
81 changes: 81 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
NODE_ENV=local

HOST=127.0.0.1
REMOTE_USERNAME=website-dev
PORT=22
# PASSWORD=wLsC20XvBjDOPxMt4lJ0
SSH_KEY='-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABB++JZyp
-----END OPENSSH PRIVATE KEY-----'
SSH_PASSPHRASE=password
TARGET=/home/website-dev/htdocs/dev.website.dev
SHA=9f17d06
ENV_FILE='APP_NAME="laravel"
APP_ENV=local
APP_KEY=base64:pz/7scAOjZebfvvtU1TK5JxccE9tZ6VYMFXYWnozSXY=
APP_DEBUG=true
APP_URL="https://dev.laravel.com"

LOG_CHANNEL=daily
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST="localhost"
DB_PORT=3306
DB_DATABASE="laravel-dev"
DB_USERNAME="laravel-dev"
DB_PASSWORD="password"

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
APP_TIMEZONE="Europe/Andorra"'
# COMMAND_SCRIPT_BEFORE_CHECK_FOLDERS=your-command
# COMMAND_SCRIPT_AFTER_CHECK_FOLDERS=your-command
# COMMAND_SCRIPT_BEFORE_DOWNLOAD=your-command
# COMMAND_SCRIPT_AFTER_DOWNLOAD=your-command
# COMMAND_SCRIPT_BEFORE_ACTIVATE=your-command
# COMMAND_SCRIPT_AFTER_ACTIVATE=your-command
GITHUB_REPO_OWNER=Laravel
GITHUB_REPO=Laravel
GITHUB_DEPLOY_BRANCH=main
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
node_modules/
coverage
docs
.vscode
.vscode
.env
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ inputs:
ssh_key:
description: 'SSH private key to connect server instead use password'
required: false
ssh_passphrase:
description: 'SSH private passphrase'
required: false
target:
description: 'Remote server target path '
required: true
sha:
description: 'Git commit sha need to deploy (github.sha)'
required: true
github_token:
description: 'Github token'
required: true
env_file:
description: 'Environment file content to sync with .env file'
required: false
deploy_branch:
description: 'Branch will deploy from'
required: true


command_script_before_check_folders:
Expand Down
26 changes: 25 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "laravel-zero-time",
"version": "1.0.0",
"description": "Deploy project to server by ssh with zero downtime deployment.",
"main": "src/index.js",
"main": "src/index.ts",
"directories": {
"test": "test"
},
Expand All @@ -14,13 +14,16 @@
"node-ssh": "^13.2.0"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1",
"dotenv": "^16.4.5",
"jest": "^29.7.0",
"nock": "^13.5.4"
"nock": "^13.5.4",
"typescript": "^5.5.4"
},
"scripts": {
"test": "jest",
"build": "ncc build src/index.js -m"
"start": "npm run build && node dist/index.js",
"build": "ncc build src/index.ts -o dist --source-map --minify"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 26b851d

Please sign in to comment.