Skip to content

Commit 9c7176a

Browse files
authored
Merge pull request #7 from AlgorithmChef/feature/final_version_ui
Feature/final version UI 최종본 병합 및 docker file 생성, docker 버전 workflow 추가
2 parents 175b589 + fccc6f0 commit 9c7176a

61 files changed

Lines changed: 6702 additions & 2054 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
.vscode
4+
.git
5+
.env

.github/workflows/frontend-ci.yml

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
1-
name: Frontend CI (Vite Build)
1+
name: Frontend Docker CI/CD (Production Ready)
22

33
on:
44
push:
5-
branches: [ "main" ] # 브랜치 이름이 master라면 수정 필요
6-
pull_request:
7-
branches: [ "main" ]
5+
branches:
6+
- develop
7+
- main
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
812

913
jobs:
10-
build-check:
14+
build-and-push:
1115
runs-on: ubuntu-latest
1216

13-
strategy:
14-
matrix:
15-
node-version: [20.x] # Vite 6.x는 최신 Node 버전(18, 20+) 권장
17+
permissions:
18+
contents: read
19+
packages: write
1620

1721
steps:
18-
# 1. 코드 가져오기
19-
- name: Checkout code
20-
uses: actions/checkout@v4
21-
22-
# 2. Node.js 설정
23-
- name: Setup Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
cache: 'npm'
28-
29-
# 3. 의존성 설치
30-
# package-lock.json이 있다면 npm ci가 더 빠르고 안전합니다.
31-
# 만약 lock 파일이 없다면 npm install로 변경해서 사용하세요.
32-
- name: Install dependencies
33-
run: npm ci
34-
35-
# 4. 빌드 확인 (핵심 단계)
36-
# Vite 빌드가 실패하면 여기서 에러가 나고, PR에 빨간불이 들어옵니다.
37-
- name: Build Project
38-
run: npm run build
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Login to GHCR
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ${{ env.REGISTRY }}
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Build and Push Docker Image
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
file: ./Dockerfile
40+
push: true
41+
42+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/frontend:latest
43+
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max

.screen-graph.json

Lines changed: 352 additions & 291 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:18 AS build
2+
WORKDIR /app
3+
COPY package.json package-lock.json ./
4+
RUN npm install
5+
COPY . .
6+
RUN npm run build
7+
FROM nginx:latest
8+
COPY --from=build /app/dist /usr/share/nginx/html
9+
EXPOSE 80
10+
CMD ["nginx", "-g", "daemon off;"]

docker-compose.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: "3.8"
2+
services:
3+
web:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
container_name: algorithm_chef_front_app
8+
9+
ports:
10+
- "5173:80"
11+
restart: always

0 commit comments

Comments
 (0)