Merge pull request 'CI/CD attempts to fix the docker containers.' (#62) from refactor/react into master
Some checks failed
Deploy application with Docker / build_and_deploy (push) Failing after 13s
Some checks failed
Deploy application with Docker / build_and_deploy (push) Failing after 13s
Reviewed-on: #62
This commit is contained in:
commit
3841f338d6
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ export default function RecipeSearchBar({ redirect, searchOnLoad, favorites, set
|
||||
|
||||
return (
|
||||
<form className="w-full px-4 my-8" onSubmit={(e) => void searchHandler(e)}>
|
||||
<div className="flex w-full gdisbaledap-x-2">
|
||||
<div className="flex w-full gap-x-2">
|
||||
<div className="relative w-full">
|
||||
<input type="hidden" name="redirect" value={JSON.stringify(redirect)} />
|
||||
<input
|
||||
@ -95,7 +95,7 @@ export default function RecipeSearchBar({ redirect, searchOnLoad, favorites, set
|
||||
placeholder="Search recipes, ingredients..."
|
||||
value={filters ? filters.Search : ""}
|
||||
onChange={queryInputHandler}
|
||||
className="w-[99%] pr-4 pl-10 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full pr-4 pl-10 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
<button className="absolute left-3 top-1/2 -translate-y-1/2">
|
||||
<svg
|
||||
|
||||
@ -17,6 +17,7 @@ import { CreateRecipe } from "../services/RecipeService";
|
||||
import type { CreateRecipeRequest } from "../types/api/recipe";
|
||||
import { isApiError } from "../types/api/error";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import ROUTE_CONSTANTS from "../types/routes";
|
||||
|
||||
// TODO: Move these
|
||||
export interface RecipeValidationEntry {
|
||||
@ -158,7 +159,7 @@ export default function Create() {
|
||||
return;
|
||||
}
|
||||
// TODO: Success toast!
|
||||
await navigate(`/web/recipe/${response.Id}`);
|
||||
await navigate(ROUTE_CONSTANTS.Recipe(response.Id));
|
||||
};
|
||||
|
||||
// Import ingredients
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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 ""
|
||||
}
|
||||
@ -8,6 +8,7 @@ const ROUTE_CONSTANTS: {
|
||||
ShoppingList: string;
|
||||
Login: string;
|
||||
History: string;
|
||||
Recipe: (id: number) => string;
|
||||
} = {
|
||||
Home: `${VERSION_FLAG}/web/home`,
|
||||
Favorites: `${VERSION_FLAG}/web/favorites`,
|
||||
@ -16,6 +17,7 @@ const ROUTE_CONSTANTS: {
|
||||
ShoppingList: `${VERSION_FLAG}/web/list`,
|
||||
Login: `${VERSION_FLAG}/web/login`,
|
||||
History: `${VERSION_FLAG}/web/history`,
|
||||
Recipe: (id: number) => `${VERSION_FLAG}/web/recipe/${id}`,
|
||||
};
|
||||
|
||||
export default ROUTE_CONSTANTS;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user