feat: backmerge
This commit is contained in:
parent
60f191c3c1
commit
12893399c8
33
.github/workflows/deploy.yml
vendored
Normal file
33
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
concurrency: production_environment
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
production:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment: Production
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
tools: composer
|
||||||
|
extensions: bcmath, ctype, fileinfo, json, odbc, mbstring, openssl, pdo, pdo_mysql, pdo_odbc tokenizer, xml, soap, redis, igbinary
|
||||||
|
php-version: "8.2"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-interaction --no-scripts --prefer-dist
|
||||||
|
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: deployphp/action@v1
|
||||||
|
with:
|
||||||
|
private-key: ${{ secrets.DEPLOY_KEY }}
|
||||||
|
dep: deploy production
|
||||||
@ -16,6 +16,7 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-ide-helper": "^2.13",
|
"barryvdh/laravel-ide-helper": "^2.13",
|
||||||
|
"deployer/deployer": "^7.3",
|
||||||
"fakerphp/faker": "^1.9.1",
|
"fakerphp/faker": "^1.9.1",
|
||||||
"laravel/breeze": "^1.24",
|
"laravel/breeze": "^1.24",
|
||||||
"laravel/pint": "^1.0",
|
"laravel/pint": "^1.0",
|
||||||
|
|||||||
48
deploy.php
Normal file
48
deploy.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Deployer;
|
||||||
|
|
||||||
|
require 'recipe/laravel.php';
|
||||||
|
require 'contrib/npm.php';
|
||||||
|
|
||||||
|
// Config
|
||||||
|
|
||||||
|
set('git_ssh_command', 'ssh');
|
||||||
|
set('repository', 'ssh://git@ssh.git.lovelynet.net:9001/PriceyBot/PriceyBotPanel.git');
|
||||||
|
|
||||||
|
add('shared_files', []);
|
||||||
|
add('shared_dirs', []);
|
||||||
|
add('writable_dirs', []);
|
||||||
|
|
||||||
|
set('http_user', 'nginx');
|
||||||
|
set('http_group', 'nginx');
|
||||||
|
set('writable_mode', 'chmod');
|
||||||
|
|
||||||
|
// Hosts
|
||||||
|
host('production')
|
||||||
|
->set('hostname', 'vps.benjamyn.love')
|
||||||
|
->set('port', '22')
|
||||||
|
->set('remote_user', 'root')
|
||||||
|
->set('deploy_path', '/opt/PriceyBotPanel');
|
||||||
|
|
||||||
|
|
||||||
|
// Tasks
|
||||||
|
task('npm:build', function () {
|
||||||
|
$command = match (get('alias')) {
|
||||||
|
'production' => 'production',
|
||||||
|
'staging' => 'development',
|
||||||
|
default => 'production'
|
||||||
|
};
|
||||||
|
run("cd {{release_path}} && {{bin/npm}} run {$command}");
|
||||||
|
});
|
||||||
|
|
||||||
|
task('perm:fix', function () {
|
||||||
|
run("chown -R nginx:nginx /opt/PriceyBotPanel");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
after('deploy:vendors', 'npm:install');
|
||||||
|
after('npm:install', 'npm:build');
|
||||||
|
after('npm:build', 'perm:fix');
|
||||||
|
after('deploy:failed', 'deploy:unlock');
|
||||||
Reference in New Issue
Block a user