From 271f9d949ff9f197991793195366e2ae8328856b Mon Sep 17 00:00:00 2001 From: MatheusDubin Date: Wed, 8 May 2024 00:48:58 -0300 Subject: [PATCH 1/2] fix: remove hardcoded production string as fallback from no VITE_API_URL so to avoid developers making changes do production data by mistake --- src/api/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/api.ts b/src/api/api.ts index 63c32077..1f56a1cc 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -3,7 +3,7 @@ import axios from 'axios'; console.log(import.meta.env.VITE_API_URL); const api = axios.create({ - baseURL: import.meta.env.VITE_API_URL ?? 'https://api.sos-rs.com', + baseURL: import.meta.env.VITE_API_URL ?? 'http://localhost:4000/', }); export { api }; From 0dd354ecfde725379c0c828412d8ffcfa06c71fc Mon Sep 17 00:00:00 2001 From: MatheusDubin Date: Thu, 9 May 2024 13:24:35 -0300 Subject: [PATCH 2/2] fix: Added pulling VITE_API_URL --- .github/workflows/deploy.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f389a18c..cf909973 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,6 +18,12 @@ jobs: - run: npm install + - name: Create .env file + run: | + touch .env + echo VITE_API_URL=${{ secrets.VITE_API_URL }} >> .env + cat .env + - run: npm run build - uses: aws-actions/configure-aws-credentials@v1