From 33c21f074991af7e3dfb4eb85b4ecca50dbccaa7 Mon Sep 17 00:00:00 2001 From: o6ez9na Date: Mon, 21 Oct 2024 22:15:25 +0300 Subject: [PATCH 1/3] fix --- frontend/src/components/api/instance.js | 2 +- .../src/components/main-page/Garden/SearchBlock/SearchBlock.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/api/instance.js b/frontend/src/components/api/instance.js index b2756be6..2959abfa 100644 --- a/frontend/src/components/api/instance.js +++ b/frontend/src/components/api/instance.js @@ -10,7 +10,7 @@ import axios from 'axios' const Instance = axios.create({ - baseURL: 'http://homelab.kerasi.ru/api/v1', + baseURL: 'http://django:8000/api/v1', timeout: 5000, headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/components/main-page/Garden/SearchBlock/SearchBlock.js b/frontend/src/components/main-page/Garden/SearchBlock/SearchBlock.js index 0899c182..7e41fb15 100644 --- a/frontend/src/components/main-page/Garden/SearchBlock/SearchBlock.js +++ b/frontend/src/components/main-page/Garden/SearchBlock/SearchBlock.js @@ -22,7 +22,7 @@ export default function SearchBlock({ onSelectItem }) { const fetchData = async () => { try { setLoading(true); - const response = await Instance.get('/garder/?format=json') + const response = await Instance.get('/garden/?format=json') setData(response.data); } catch (err) { setError(err); From 0df8fde57731813fe0491ba81dca5b120d197cf8 Mon Sep 17 00:00:00 2001 From: kseen Date: Mon, 21 Oct 2024 22:17:17 +0300 Subject: [PATCH 2/3] Update release workflow to set IS_RELEASE to True and add tag existence check --- .github/workflows/on-release.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index e2b40bef..7761ada2 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -16,8 +16,8 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - IS_RELEASE: ${{ github.event.pull_request.merged }} - # IS_RELEASE: True + # IS_RELEASE: ${{ github.event.pull_request.merged }} + IS_RELEASE: True DJANGO_SUFFIX: -django FRONTEND_SUFFIX: -frontend NGINX_SUFFIX: -nginx @@ -41,6 +41,22 @@ jobs: echo "NGINX_SUFFIX: ${{ env.NGINX_SUFFIX }}" echo "PSQL_SUFFIX: ${{ env.PSQL_SUFFIX }}" echo "PULL_REQUEST_MERGED: ${{ github.event.pull_request.merged }}" + + check-if-container-tag-is-not-exist: + runs-on: ubuntu-latest + steps: + - name: Check if container tag is not exist + id: check + run: | + TAG=${{ github.event.release.tag_name }} + if curl -s -I https://ghcr.io/v2/${{ github.repository }}/manifests/$TAG | grep -q "404 Not Found"; then + echo "Tag $TAG does not exist" + echo "::set-output name=tag_not_exist::true" + else + echo "Tag $TAG already exists" + echo "::set-output name=tag_not_exist::false" + fi + build-and-push-image-django: runs-on: ubuntu-latest # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. From 42d95645f6467289ac76ac5cda12754c4601165f Mon Sep 17 00:00:00 2001 From: kseen Date: Mon, 21 Oct 2024 22:17:53 +0300 Subject: [PATCH 3/3] Remove redundant tag existence check from release workflow --- .github/workflows/on-release.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 7761ada2..da4472e6 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -41,21 +41,6 @@ jobs: echo "NGINX_SUFFIX: ${{ env.NGINX_SUFFIX }}" echo "PSQL_SUFFIX: ${{ env.PSQL_SUFFIX }}" echo "PULL_REQUEST_MERGED: ${{ github.event.pull_request.merged }}" - - check-if-container-tag-is-not-exist: - runs-on: ubuntu-latest - steps: - - name: Check if container tag is not exist - id: check - run: | - TAG=${{ github.event.release.tag_name }} - if curl -s -I https://ghcr.io/v2/${{ github.repository }}/manifests/$TAG | grep -q "404 Not Found"; then - echo "Tag $TAG does not exist" - echo "::set-output name=tag_not_exist::true" - else - echo "Tag $TAG already exists" - echo "::set-output name=tag_not_exist::false" - fi build-and-push-image-django: runs-on: ubuntu-latest