Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Doddle Frontend

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build and tag Docker image
run: |
docker build --no-cache --build-arg API_DOMAIN=${{ secrets.API_DOMAIN_DEPLOY }} -t fe_deploy .
docker tag fe_deploy fe_deploy:latest

- name: Deploy container locally
run: |
IMAGE=fe_deploy:latest
docker stop FE_DEPLOY || true
docker rm FE_DEPLOY || true
docker run -d --name FE_DEPLOY -p 25120:80 $IMAGE
docker system prune -af
28 changes: 28 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: DEV Deploy Doddle Frontend

on:
push:
branches:
- dev
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build and tag Docker image
run: |
docker build --no-cache --build-arg API_DOMAIN=${{ secrets.API_DOMAIN_DEV }} -t fe_dev .
docker tag fe_dev fe_dev:latest

- name: Deploy container locally
run: |
IMAGE=fe_dev:latest
docker stop FE_DEV || true
docker rm FE_DEV || true
docker run -d --name FE_DEV -p 25119:80 $IMAGE
docker system prune -af
28 changes: 0 additions & 28 deletions .github/workflows/docker-image.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ WORKDIR /app
COPY package*.json ./
RUN npm install --legacy-peer-deps

ARG API_DOMAIN
ENV VITE_API_DOMAIN=${API_DOMAIN}

# 애플리케이션 코드 복사 및 빌드
COPY . .
RUN npm run build
Expand Down
4 changes: 3 additions & 1 deletion src/services/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import axios from "axios";
import Cookies from "js-cookie";

const API_DOMAIN = import.meta.env.VITE_API_DOMAIN;

const axiosClient = axios.create({
baseURL: "https://doddle.kr/api",
baseURL: `https://${API_DOMAIN}/api`,
headers: {
"Content-Type": "application/json",
},
Expand Down