Skip to content

Commit

Permalink
Updated vite assets url and deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
faab007nl committed Nov 9, 2023
1 parent 85d2332 commit 2530c3a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
29 changes: 18 additions & 11 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,54 @@ echo "-----------------------------------"

# Enter maintenance mode or return true
# if already is in maintenance mode
echo "1/11 Entering maintenance mode"
echo "1/12 Entering maintenance mode"
(php8.1 artisan down) || true

# Stash all changes
echo "2/11 Stash all changes"
echo "2/12 Stash all changes"
git stash

# Pull the latest version of the app
echo "3/11 Pull the latest version of the app"
echo "3/12 Pull the latest version of the app"
git pull origin production

# Pop the stashed changes
echo "4/11 Pop the stashed changes"
echo "4/12 Pop the stashed changes"
git stash pop

# Install composer dependencies
echo "5/11 Install composer dependencies"
echo "5/12 Install composer dependencies"
/usr/bin/php8.1 /usr/local/bin/composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader

# Clear the old cache
echo "6/11 Clear the old cache"
echo "6/12 Clear the old cache"
php8.1 artisan clear-compiled

# Recreate cache
echo "7/11 Recreate cache"
echo "7/12 Recreate cache"
php8.1 artisan optimize

# Compile npm assets
echo "8/11 Install npm dependencies"
echo "8/12 Install npm dependencies"
npm install --no-progress --prefer-dist

# Compile npm assets
echo "9/11 Compile npm assets"
echo "9/12 Compile npm assets"
npm run prod

# Run database migrations
echo "10/11 Run database migrations"
echo "10/12 Run database migrations"
php8.1 artisan migrate --force

# Recreate cache
echo "11/12 Recreate cache"
php8.1 artisan config:cache
php8.1 artisan route:cache
php8.1 artisan event:cache
php8.1 artisan view:cache

# Exit maintenance mode
echo "11/11 Exit maintenance mode"
echo "12/12 Exit maintenance mode"
php8.1 artisan up

echo "Deployment finished!"
4 changes: 2 additions & 2 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>TechsCode Updater</title>
<link rel="shortcut icon" href="{{ \Illuminate\Support\Facades\Vite::asset('resource/images/logo.png') }}" type="image/x-icon">
<link rel="shortcut icon" href="{{ \Illuminate\Support\Facades\Vite::asset('resources/images/logo.png') }}" type="image/x-icon">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
@vite('resources/scss/app.scss')
</head>
<body>
<div class="header">
<img src="{{ \Illuminate\Support\Facades\Vite::asset('resource/images/logo_wide.png') }}" alt="">
<img src="{{ \Illuminate\Support\Facades\Vite::asset('resources/images/logo_wide.png') }}" alt="">
</div>
<div class="container">
@yield('content')
Expand Down

0 comments on commit 2530c3a

Please sign in to comment.