From 9aae3144fe52d5dd0c3edd05511589338d00e699 Mon Sep 17 00:00:00 2001 From: Maarten Date: Tue, 26 Nov 2024 08:42:01 +0100 Subject: [PATCH] Add deploy --- composer.json | 3 ++- composer.lock | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++- deploy.php | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 deploy.php diff --git a/composer.json b/composer.json index baa95f6..15e4192 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ "vlucas/phpdotenv": "^5.6" }, "require-dev": { - "symfony/var-dumper": "^7.1" + "symfony/var-dumper": "^7.1", + "deployer/deployer": "^7.5" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 0e23b67..a84f268 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1cf0b28b832329259051c7f187bc436f", + "content-hash": "8361a985ae54592bf8899924d98feb73", "packages": [ { "name": "filp/whoops", @@ -589,6 +589,60 @@ } ], "packages-dev": [ + { + "name": "deployer/deployer", + "version": "v7.5.5", + "source": { + "type": "git", + "url": "https://github.com/deployphp/deployer.git", + "reference": "1b37d639e0ffad980f6cc3873859b16de29ecad7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/deployphp/deployer/zipball/1b37d639e0ffad980f6cc3873859b16de29ecad7", + "reference": "1b37d639e0ffad980f6cc3873859b16de29ecad7", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^8.0|^7.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.64", + "pestphp/pest": "^3.3", + "phpstan/phpstan": "^1.4", + "phpunit/php-code-coverage": "^11.0", + "phpunit/phpunit": "^11.4" + }, + "bin": [ + "bin/dep" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Medvedev", + "email": "anton@medv.io" + } + ], + "description": "Deployment Tool", + "homepage": "https://deployer.org", + "support": { + "docs": "https://deployer.org/docs", + "issues": "https://github.com/deployphp/deployer/issues", + "source": "https://github.com/deployphp/deployer" + }, + "funding": [ + { + "url": "https://github.com/sponsors/antonmedv", + "type": "github" + } + ], + "time": "2024-11-08T13:18:44+00:00" + }, { "name": "symfony/var-dumper", "version": "v7.1.8", diff --git a/deploy.php b/deploy.php new file mode 100644 index 0000000..3df9cc7 --- /dev/null +++ b/deploy.php @@ -0,0 +1,51 @@ +set('remote_user', 'maartenvr98-bit') + ->set('deploy_path', '/home/maartenvr98-bit/htdocs/bit.maartenvr98.nl') + ->set('branch', 'main'); + +// Tasks +task('assets:build', function () { + runLocally('yarn install && yarn build'); +}); + +task('assets:upload', function () { + upload('public/dist', '{{release_path}}/public'); +}); + +// Main deploy task +desc('Deploy your project'); +task('deploy', [ + 'deploy:prepare', + 'deploy:vendors', + 'assets:build', + 'assets:upload', + 'deploy:publish', +]); + +// Hooks +after('deploy:failed', 'deploy:unlock');