update
This commit is contained in:
@@ -12,62 +12,27 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: appleboy/ssh-action@7eaf76671a0d7eec5d98ee897acda4f968735a17 # v1.2.0
|
uses: appleboy/ssh-action@7eaf76671a0d7eec5d98ee897acda4f968735a17
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.HOST }}
|
host: ${{ secrets.HOST }}
|
||||||
username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
fingerprint: ${{ secrets.SSH_HOST_FINGERPRINT }}
|
|
||||||
port: ${{ secrets.PORT }}
|
port: ${{ secrets.PORT }}
|
||||||
script_stop: true
|
script_stop: true
|
||||||
|
|
||||||
script: |
|
script: |
|
||||||
set -ex
|
set -e
|
||||||
|
|
||||||
export PATH="$HOME/.phpenv/shims:$PATH"
|
cd ~/httpdocs
|
||||||
umask 002
|
|
||||||
|
|
||||||
php -v
|
echo "==> Pulling latest code..."
|
||||||
|
git fetch origin production
|
||||||
BRANCH="production"
|
git reset --hard origin/production
|
||||||
|
|
||||||
cd httpdocs
|
|
||||||
|
|
||||||
if test -d .git; then
|
|
||||||
echo "Updating source..."
|
|
||||||
|
|
||||||
git fetch origin
|
|
||||||
|
|
||||||
git reset --hard origin/$BRANCH
|
|
||||||
else
|
|
||||||
echo "First deploy..."
|
|
||||||
|
|
||||||
git clone -b "$BRANCH" "${{ secrets.REPO_URL }}" .
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p storage/framework/{cache,sessions,views} storage/logs bootstrap/cache
|
|
||||||
chmod -R u+rwX storage bootstrap/cache vendor 2>/dev/null || true
|
|
||||||
|
|
||||||
if test -e vendor/composer/installed.php && ! test -w vendor/composer/installed.php; then
|
|
||||||
echo "vendor/composer/installed.php is not writable by $(whoami). Current ownership:"
|
|
||||||
ls -ld vendor vendor/composer vendor/composer/installed.php
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -d vendor/composer && ! test -w vendor/composer; then
|
|
||||||
echo "vendor/composer is not writable by $(whoami). Current ownership:"
|
|
||||||
ls -ld vendor vendor/composer
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
composer install --no-dev --optimize-autoloader
|
|
||||||
|
|
||||||
composer dump-autoload --no-dev --optimize
|
|
||||||
|
|
||||||
|
echo "==> Running migrations..."
|
||||||
php artisan migrate --force
|
php artisan migrate --force
|
||||||
|
|
||||||
php artisan config:clear
|
echo "==> Optimizing Laravel..."
|
||||||
php artisan optimize
|
php artisan optimize
|
||||||
|
|
||||||
php artisan queue:restart || true
|
echo "==> Deploy completed!"
|
||||||
|
|
||||||
echo "Deploy completed."
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class CreateCustomerRequest extends FormRequest
|
|||||||
'fullname' => 'required',
|
'fullname' => 'required',
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'password' => $this->isMethod('post') ? 'required|min:6' : 'nullable|min:6',
|
'password' => $this->isMethod('post') ? 'required|min:6' : 'nullable|min:6',
|
||||||
|
'status' => 'nullable|integer|in:0,1,2,3',
|
||||||
'company' => 'nullable',
|
'company' => 'nullable',
|
||||||
'phone' => 'nullable',
|
'phone' => 'nullable',
|
||||||
'address' => 'nullable',
|
'address' => 'nullable',
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('customers', function (Blueprint $table) {
|
||||||
|
$table->integer('unpaid_total')->default(0)->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void {}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user