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
9 changes: 7 additions & 2 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ name: Backend CI
# main 브랜치와 backend 디렉토리 또는 워크플로우 파일이 변경될 때
# .github/workflows/backend-ci.yml 파일이 실행되도록 설정
# workflow_dispatch는 Github UI에서 수동으로 워크플로우를 실행할 수 있도록 설정
# push와 pull_request 이벤트는 또 반드시 branches를 명시해야한다.
# push 이벤트에서 brnaches: [main]의 의미는
# main 브랜치에 대한 push 이벤트가 발생했을 때, 혹은 main으로의 merge가 발생했을 때
# pull_request 이벤트에서 branches: [main]의 의미는
# main 브랜치로의 PR이 생성되었을 때, 혹은 main 브랜치로의 PR이 업데이트 되었을 때를 의미한다.
on:
push: #push 발생했고
branches: [main] # main 브랜치에 대한 변경이고
branches: [main] # 이 두 부분이 분명히 있어야 CI가 두 번 돌 지 않는다.
paths:
- "backend/**" # backend 디렉토리 내부의 모든 파일이 변경되었을 때
- ".github/workflows/backend-ci.yml" # 워크플로우 파일이 변경되었을 때
pull_request:
branches: [main]
branches: [main] # 이 두 부분이 분명히 있어야 CI가 두 번 돌 지 않는다.
paths:
- "backend/**"
- ".github/workflows/backend-ci.yml"
Expand Down
36 changes: 36 additions & 0 deletions k8s/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-deployment
labels:
app: backend
spec:
replicas: 1
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
image: lylekim/my-backend:latest
ports:
- containerPort: 8000
env:
- name: DJANGO_SETTINGS_MODULE
value: "config.settings"
---
apiVersion: v1
kind: Service
metadata:
name: backend-service
spec:
type: ClusterIP
selector:
app: backend
ports:
- port: 8000
targetPort: 8000
34 changes: 34 additions & 0 deletions k8s/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend-deployment
labels:
app: frontend
spec:
replicas: 1
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: lylekim/my-frontend:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: frontend-service
spec:
type: NodePort
selector:
app: frontend
ports:
- port: 80
targetPort: 80
nodePort: 30080 # 로컬 접속 테스트용
Loading