(CI/CD): This might actually fix the problems

This commit is contained in:
Hayden Hargreaves 2026-01-08 21:54:55 -07:00
parent cbaf34d39c
commit fd113091a0
7 changed files with 8 additions and 15 deletions

View File

@ -25,7 +25,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: azpect3120/potion.gophernest:latest
tags: azpect3120/potion.backend:latest
- name: Build and push frontend Docker image
uses: docker/build-push-action@v5
@ -36,5 +36,3 @@ jobs:
tags: azpect3120/potion.frontend:latest
build-args: |
VITE_ENVIRONMENT=prod
VITE_DOMAIN_DEV=http://localhost:3000
VITE_DOMAIN_PROD=https://potion-backend.gophernest.net

View File

@ -7,14 +7,9 @@ RUN npm install
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_DOMAIN_DEV=http://localhost:3000
ARG VITE_DOMAIN_PROD=https://potion-backend.gophernest.net
ENV VITE_ENVIRONMENT=$VITE_ENVIRONMENT
ENV VITE_DOMAIN_DEV=$VITE_DOMAIN_DEV
ENV VITE_DOMAIN_PROD=$VITE_DOMAIN_PROD
RUN npm run build

View File

@ -1,7 +1,7 @@
import axios from "axios";
import type { GetGoogleAuthUrlResponse, LogoutResponse } from "../types/api/auth";
import type { ApiError } from "../types/api/error";
import { GetBackendUrl } from "./util";
import { GetBackendUrl } from "./environment";
const BACKEND_URL = GetBackendUrl();

View File

@ -2,7 +2,7 @@ import axios from "axios";
import type { ApiError } from "../types/api/error";
import type { Engagement } from "../types/engagement";
import type { EngagementFavoriteRecipeResponse, EngagementMakeRecipeResponse, EngagementShareRecipeResponse, EngagementViewRecipeResponse } from "../types/api/engagement";
import { GetBackendUrl } from "./util";
import { GetBackendUrl } from "./environment";
const BACKEND_URL = GetBackendUrl();

View File

@ -3,7 +3,7 @@ import type { CreateRecipeRequest, CreateRecipeResponse, GetRecipeOfTheWeekRespo
import type { Recipe } from "../types/recipe";
import type { ApiError } from "../types/api/error";
import type { SearchFilters } from "../types/search";
import { GetBackendUrl } from "./util";
import { GetBackendUrl } from "./environment";
const BACKEND_URL = GetBackendUrl();

View File

@ -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 { Recipe } from "../types/recipe";
import type { Engagement } from "../types/engagement";
import { GetBackendUrl } from "./util";
import { GetBackendUrl } from "./environment";
const BACKEND_URL = GetBackendUrl();

View File

@ -6,9 +6,9 @@ export function GetBackendUrl(): string {
switch (env.toLowerCase()) {
case "dev":
return ENV.VITE_DOMAIN_DEV as string;
return "http://localhost:3000";
case "prod":
return ENV.VITE_DOMAIN_PROD as string;
return "https://potion-backend.gophernest.net";
default:
return ""
}