Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@ B2_ENDPOINT=

VITE_APP_NAME="${APP_NAME}"

DEPLOY_USER=
DEPLOY_HOST=
DEPLOY_PATH=

SAIL_XDEBUG_MODE=develop,debug,coverage
SAIL_XDEBUG_CONFIG="discover_client_host=1 client_port=9003"
59 changes: 59 additions & 0 deletions Envoy.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@servers(['local' => ['127.0.0.1'], 'server' => ['root@143.198.129.111']])

@story('deploy', ['skipBackup' => false])
@if(!$skipBackup)
backup-database
@endif
update-code
install-dependencies
down
perform-migration
deploy-frontend
up
@endstory

@task('down', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
php artisan down
@endtask

@task('up', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
php artisan up
@endtask

@task('backup-database', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
php artisan backup:run --only-db
@endtask

@task('update-code', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
git pull origin master
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'master' branch name may be outdated. Consider using 'main' if that's the default branch, or make the branch name configurable to avoid assumptions about repository structure.

Suggested change
git pull origin master
git pull origin {{ $branch }}

Copilot uses AI. Check for mistakes.
@endtask

@task('install-dependencies', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
composer install --no-dev --optimize-autoloader
@endtask

@task('perform-migration', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.

Suggested change
cd /var/www/ComputerScienceResources.com
cd {{ $deploy_path }}
php artisan down
@endtask
@task('up', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
php artisan up
@endtask
@task('backup-database', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
php artisan backup:run --only-db
@endtask
@task('update-code', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
git pull origin master
@endtask
@task('install-dependencies', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
composer install --no-dev --optimize-autoloader
@endtask
@task('perform-migration', ['on' => 'server'])
set -e
cd {{ $deploy_path }}

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.

Suggested change
cd /var/www/ComputerScienceResources.com
cd {{ $deploy_path }}
php artisan down
@endtask
@task('up', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
php artisan up
@endtask
@task('backup-database', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
php artisan backup:run --only-db
@endtask
@task('update-code', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
git pull origin master
@endtask
@task('install-dependencies', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
composer install --no-dev --optimize-autoloader
@endtask
@task('perform-migration', ['on' => 'server'])
set -e
cd {{ $deploy_path }}

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.

Suggested change
cd /var/www/ComputerScienceResources.com
cd {{ $DEPLOY_PATH }}
php artisan down
@endtask
@task('up', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
php artisan up
@endtask
@task('backup-database', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
php artisan backup:run --only-db
@endtask
@task('update-code', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
git pull origin master
@endtask
@task('install-dependencies', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
composer install --no-dev --optimize-autoloader
@endtask
@task('perform-migration', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.

Suggested change
cd /var/www/ComputerScienceResources.com
cd {{ $deploy_path }}
php artisan down
@endtask
@task('up', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
php artisan up
@endtask
@task('backup-database', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
php artisan backup:run --only-db
@endtask
@task('update-code', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
git pull origin master
@endtask
@task('install-dependencies', ['on' => 'server'])
set -e
cd {{ $deploy_path }}
composer install --no-dev --optimize-autoloader
@endtask
@task('perform-migration', ['on' => 'server'])
set -e
cd {{ $deploy_path }}

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.

Suggested change
cd /var/www/ComputerScienceResources.com
cd {{ $DEPLOY_PATH }}
php artisan down
@endtask
@task('up', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
php artisan up
@endtask
@task('backup-database', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
php artisan backup:run --only-db
@endtask
@task('update-code', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
git pull origin master
@endtask
@task('install-dependencies', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}
composer install --no-dev --optimize-autoloader
@endtask
@task('perform-migration', ['on' => 'server'])
set -e
cd {{ $DEPLOY_PATH }}

Copilot uses AI. Check for mistakes.
php artisan migrate --force
@endtask

@task('deploy-frontend', ['on' => 'local'])
set -e
echo "Building frontend locally..."
npm ci
npm run build

echo "Copying compiled assets to server..."
scp -r {{ __DIR__ }}/public/build root@143.198.129.111:/var/www/ComputerScienceResources.com/public
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using SCP with hard-coded credentials exposes sensitive server information. Consider using SSH keys with a configured host alias or environment variables for server details.

Suggested change
scp -r {{ __DIR__ }}/public/build root@143.198.129.111:/var/www/ComputerScienceResources.com/public
scp -r {{ __DIR__ }}/public/build production-server:/var/www/ComputerScienceResources.com/public

Copilot uses AI. Check for mistakes.
@endtask
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"spatie/laravel-activitylog": "^4.10",
"spatie/laravel-backup": "^9.3",
"spatie/laravel-tags": "^4.9",
"symfony/http-client": "^7.3",
"symfony/mailgun-mailer": "^7.3",
"tightenco/ziggy": "^2.0",
"yaza/laravel-google-drive-storage": "^4.1"
},
Expand All @@ -32,6 +34,7 @@
"barryvdh/laravel-ide-helper": "^3.5",
"beyondcode/laravel-query-detector": "^2.0",
"fakerphp/faker": "^1.23",
"laravel/envoy": "^2.10",
"laravel/pail": "^1.1",
"laravel/pint": "^1.24",
"laravel/sail": "^1.40",
Expand Down
Loading