Skip to content

Commit

Permalink
Fix deploy to NetAngels (gomzyakov#12)
Browse files Browse the repository at this point in the history
* Update `platform-check` param to false in composer.json
* Update README.md
* Add .htaccess to project root
* Update laravel.yml
* Add `git show --summary`
  • Loading branch information
gomzyakov authored Apr 26, 2022
1 parent 9fad237 commit 9754eb9
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
- name: Compile assets for production
run: npm run production

# TODO Запускать только на релизах
deploy:
runs-on: ubuntu-latest
# TODO Manual action
needs: laravel_tests
steps:
- name: Checkout
Expand All @@ -58,9 +58,12 @@ jobs:
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
username: web
password: ${{ secrets.SSH_PASSWORD }}
# TODO composer install --allow-root --no-interaction
script: |
whoami
cd /var/www/web/sites/secretnotes.ru
git pull origin main
git show --summary
9 changes: 5 additions & 4 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Это файл .htaccess необходим для корректной работы на VDS NetAndels
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sudo apt install software-properties-common
sudo apt update
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.0-common php8.0-cli -y
sudo apt install php8.0-common php8.0-cli php8.0-mysql php8.0-mbstring -y
```

Если необходимо, доустанавливаем PHP-расширения на виртуалке:
Expand Down Expand Up @@ -79,13 +79,36 @@ php -r "file_exists('.env') || copy('.env.example', '.env');"
composer install
chmod -R 777 storage bootstrap/cache
php artisan key:generate
chmod -R 777 storage bootstrap/cache
Вносим корректные реквизиты в `.env` файл:
Создаём БД `secretnotes` через phpMyAdmin
php artisan migrate:fresh --seed
## Front
На виртуалке:
cd ~
curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh
sudo bash /tmp/nodesource_setup.sh
sudo apt install nodejs
При вводе `node -v` видим:
v16.6.1
sudo apt install npm
После этого билдим непосредственно фронтовые зависимости:
npm install
npm run production
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"platform-check": false
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
2 changes: 1 addition & 1 deletion resources/views/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="p-6">
<div class="flex items-center">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" class="w-8 h-8 text-gray-500"><path d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"></path></svg>
<div class="ml-4 text-lg leading-7 font-semibold"><a href="https://laravel.com/docs" class="underline text-gray-900 dark:text-white">Documentation</a></div>
<div>Тест</div>
</div>

<div class="ml-12">
Expand Down

0 comments on commit 9754eb9

Please sign in to comment.