Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,41 @@ jobs:
script: |
core.setFailed('Workflow failed. Release version does not match with selected target branch. Did you select the correct branch?')

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Create sqlite database
run: touch storage/database.sqlite

- name: Set up the .env file
run: cp .env.example .env

- name: Generate Application Key
run: php artisan key:generate

- name: Migrate database
run: php artisan migrate:refresh --seed
env:
APP_ENV: local
APP_DEMO: true

- name: Generate API Docs
run: php artisan scribe:generate
- name: Update config/app.php
run: sed -i "s/'version' => '[^']*'/'version' => '${{ steps.version.outputs.version }}'/" config/app.php

Expand All @@ -89,6 +124,7 @@ jobs:
- name: Build assets
run: npm run build

# Release
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
8 changes: 7 additions & 1 deletion database/factories/DeploymentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Database\Factories;

use App\Enums\DeploymentStatus;
use App\Models\Deployment;
use Illuminate\Database\Eloquent\Factories\Factory;

Expand All @@ -15,7 +16,12 @@ class DeploymentFactory extends Factory
public function definition(): array
{
return [
//
'site_id' => 1,
'deployment_script_id' => 1,
'log_id' => 1,
'commit_id' => 'id',
'commit_data' => [],
'status' => DeploymentStatus::FINISHED,
];
}
}
1 change: 1 addition & 0 deletions database/factories/ServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function definition(): array
'server_id' => 1,
'type' => 'webserver',
'name' => 'nginx',
'version' => 'latest',
'status' => ServiceStatus::READY,
];
}
Expand Down
1 change: 1 addition & 0 deletions database/factories/SslFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class SslFactory extends Factory
public function definition(): array
{
return [
'site_id' => 1,
'type' => $this->faker->word(),
'certificate' => $this->faker->word(),
'pk' => $this->faker->word(),
Expand Down
17 changes: 1 addition & 16 deletions database/seeders/ServersSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ private function createResources(User $user, Project $project): void
/** @var Tag $tag */
foreach ($project->tags()->get() as $tag) {
$provider = $providers->random();
// database
/** @var Server $db */
$db = Server::factory()->create([
'user_id' => $user->id,
'project_id' => $project->id,
'name' => $tag->name.'-'.'database',
'provider' => $provider->provider,
'provider_id' => $provider->id,
]);
$db->tags()->attach($tag->id);
$this->database($db);
$this->firewall($db);
$this->monitoring($db);
$this->redis($db);

// app-1
/** @var Server $app */
$app = Server::factory()->create([
'user_id' => $user->id,
Expand All @@ -61,6 +45,7 @@ private function createResources(User $user, Project $project): void
$this->php($app);
$this->firewall($app);
$this->monitoring($app);
$this->database($app);
$this->supervisor($app);
$this->redis($app);
}
Expand Down