From 8c7f49f50f418e08d83ae086e6e42b0ec524b839 Mon Sep 17 00:00:00 2001 From: butschster Date: Fri, 21 Feb 2025 11:42:51 +0400 Subject: [PATCH] Fixed frontend assets path --- .github/workflows/docker-image.yml | 4 ++-- app.php | 2 +- app/src/Interfaces/Http/Handler/FrontendRequest.php | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 311dc10..f94dcf7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -48,7 +48,7 @@ jobs: push: true build-args: | APP_VERSION=${{ github.ref_name }} - FRONTEND_IMAGE_TAG=latest + FRONTEND_IMAGE_TAG=${{ secrets.FRONTEND_IMAGE_TAG }} BRANCH=${{ github.ref_name }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} @@ -96,7 +96,7 @@ jobs: push: true build-args: | APP_VERSION=${{ github.ref_name }} - FRONTEND_IMAGE_TAG=latest + FRONTEND_IMAGE_TAG=${{ secrets.FRONTEND_IMAGE_TAG }} BRANCH=${{ github.ref_name }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/app.php b/app.php index 09c51d8..7b5be99 100644 --- a/app.php +++ b/app.php @@ -22,7 +22,7 @@ directories: [ 'root' => __DIR__, 'modules' => __DIR__ . '/app/modules', - 'public' => __DIR__ . '/frontend', + 'public' => __DIR__ . '/frontend/dist', ], exceptionHandler: Handler::class, )->run(); diff --git a/app/src/Interfaces/Http/Handler/FrontendRequest.php b/app/src/Interfaces/Http/Handler/FrontendRequest.php index 4fde72c..3321e97 100644 --- a/app/src/Interfaces/Http/Handler/FrontendRequest.php +++ b/app/src/Interfaces/Http/Handler/FrontendRequest.php @@ -68,7 +68,8 @@ private function isValidRequest(ServerRequestInterface $request): bool $path = $request->getUri()->getPath(); return $path === '/' - || \str_starts_with($path, '/_nuxt/') + || \str_starts_with($path, '/src/') + || \str_starts_with($path, '/assets/') || $path === '/favicon/favicon.ico' || $path === '/bg.jpg'; }