(CI/CD): This might actually fix the problems
This commit is contained in:
parent
cbaf34d39c
commit
fd113091a0
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: azpect3120/potion.gophernest:latest
|
tags: azpect3120/potion.backend:latest
|
||||||
|
|
||||||
- name: Build and push frontend Docker image
|
- name: Build and push frontend Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
@ -36,5 +36,3 @@ jobs:
|
|||||||
tags: azpect3120/potion.frontend:latest
|
tags: azpect3120/potion.frontend:latest
|
||||||
build-args: |
|
build-args: |
|
||||||
VITE_ENVIRONMENT=prod
|
VITE_ENVIRONMENT=prod
|
||||||
VITE_DOMAIN_DEV=http://localhost:3000
|
|
||||||
VITE_DOMAIN_PROD=https://potion-backend.gophernest.net
|
|
||||||
|
|||||||
@ -7,14 +7,9 @@ RUN npm install
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build-time config: defaults are prod-safe, can be overridden if needed
|
# Build-time config: just env selector
|
||||||
ARG VITE_ENVIRONMENT=prod
|
ARG VITE_ENVIRONMENT=prod
|
||||||
ARG VITE_DOMAIN_DEV=http://localhost:3000
|
|
||||||
ARG VITE_DOMAIN_PROD=https://potion-backend.gophernest.net
|
|
||||||
|
|
||||||
ENV VITE_ENVIRONMENT=$VITE_ENVIRONMENT
|
ENV VITE_ENVIRONMENT=$VITE_ENVIRONMENT
|
||||||
ENV VITE_DOMAIN_DEV=$VITE_DOMAIN_DEV
|
|
||||||
ENV VITE_DOMAIN_PROD=$VITE_DOMAIN_PROD
|
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import type { GetGoogleAuthUrlResponse, LogoutResponse } from "../types/api/auth";
|
import type { GetGoogleAuthUrlResponse, LogoutResponse } from "../types/api/auth";
|
||||||
import type { ApiError } from "../types/api/error";
|
import type { ApiError } from "../types/api/error";
|
||||||
import { GetBackendUrl } from "./util";
|
import { GetBackendUrl } from "./environment";
|
||||||
|
|
||||||
const BACKEND_URL = GetBackendUrl();
|
const BACKEND_URL = GetBackendUrl();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import axios from "axios";
|
|||||||
import type { ApiError } from "../types/api/error";
|
import type { ApiError } from "../types/api/error";
|
||||||
import type { Engagement } from "../types/engagement";
|
import type { Engagement } from "../types/engagement";
|
||||||
import type { EngagementFavoriteRecipeResponse, EngagementMakeRecipeResponse, EngagementShareRecipeResponse, EngagementViewRecipeResponse } from "../types/api/engagement";
|
import type { EngagementFavoriteRecipeResponse, EngagementMakeRecipeResponse, EngagementShareRecipeResponse, EngagementViewRecipeResponse } from "../types/api/engagement";
|
||||||
import { GetBackendUrl } from "./util";
|
import { GetBackendUrl } from "./environment";
|
||||||
|
|
||||||
const BACKEND_URL = GetBackendUrl();
|
const BACKEND_URL = GetBackendUrl();
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import type { CreateRecipeRequest, CreateRecipeResponse, GetRecipeOfTheWeekRespo
|
|||||||
import type { Recipe } from "../types/recipe";
|
import type { Recipe } from "../types/recipe";
|
||||||
import type { ApiError } from "../types/api/error";
|
import type { ApiError } from "../types/api/error";
|
||||||
import type { SearchFilters } from "../types/search";
|
import type { SearchFilters } from "../types/search";
|
||||||
import { GetBackendUrl } from "./util";
|
import { GetBackendUrl } from "./environment";
|
||||||
|
|
||||||
const BACKEND_URL = GetBackendUrl();
|
const BACKEND_URL = GetBackendUrl();
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import type { User } from "../types/user";
|
|||||||
import type { GetAuthenticateUserEngagementResponse, GetAuthenticateUserFavoritesResponse, GetAuthenticateUserMadeRecipesResponse, GetAuthenticateUserRecipesResponse, GetAuthenticateUserResponse, GetAuthenticateUserViewedRecipesResponse, GetUserResponse } from "../types/api/user";
|
import type { GetAuthenticateUserEngagementResponse, GetAuthenticateUserFavoritesResponse, GetAuthenticateUserMadeRecipesResponse, GetAuthenticateUserRecipesResponse, GetAuthenticateUserResponse, GetAuthenticateUserViewedRecipesResponse, GetUserResponse } from "../types/api/user";
|
||||||
import type { Recipe } from "../types/recipe";
|
import type { Recipe } from "../types/recipe";
|
||||||
import type { Engagement } from "../types/engagement";
|
import type { Engagement } from "../types/engagement";
|
||||||
import { GetBackendUrl } from "./util";
|
import { GetBackendUrl } from "./environment";
|
||||||
|
|
||||||
const BACKEND_URL = GetBackendUrl();
|
const BACKEND_URL = GetBackendUrl();
|
||||||
|
|
||||||
|
|||||||
@ -6,9 +6,9 @@ export function GetBackendUrl(): string {
|
|||||||
|
|
||||||
switch (env.toLowerCase()) {
|
switch (env.toLowerCase()) {
|
||||||
case "dev":
|
case "dev":
|
||||||
return ENV.VITE_DOMAIN_DEV as string;
|
return "http://localhost:3000";
|
||||||
case "prod":
|
case "prod":
|
||||||
return ENV.VITE_DOMAIN_PROD as string;
|
return "https://potion-backend.gophernest.net";
|
||||||
default:
|
default:
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user