Skip to content

Commit 51211c1

Browse files
committed
ci: 도커 이미지 빌드 액션 기능 추가
1 parent 3d92a61 commit 51211c1

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Docker Publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Docker 이미지 빌드
13+
run: docker build -t seaproject/my-app:latest .
14+
15+
- name: Docker Hub에 로그인
16+
uses: docker/login-action@v2
17+
with:
18+
username: ${{ secrets.DOCKERHUB_USERNAME }}
19+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
20+
21+
- name: Docker 이미지 푸시
22+
run: docker push seaproject/my-app:latest

dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
RUN npm run build
12+
13+
EXPOSE 3000
14+
15+
CMD [ "npm", "start" ]

0 commit comments

Comments
 (0)