Skip to content

Commit c443daa

Browse files
committed
hotfix: docker image build 를 git action ci/cd 로 추가
1 parent a562bcb commit c443daa

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,49 @@ jobs:
8080

8181
- name: Run build
8282
run: pnpm run build
83+
84+
# Docker 로그인
85+
- name: Log in to Docker Hub
86+
uses: docker/login-action@v3
87+
with:
88+
username: ${{ secrets.DOCKER_USERNAME }}
89+
password: ${{ secrets.DOCKER_PASSWORD }}
90+
91+
# Docker 이미지 빌드
92+
- name: Build Docker Image
93+
run: |
94+
docker build -t velog-dashboard-v2-fe:latest .
95+
96+
# Docker Hub에 푸시
97+
- name: Push Docker Image
98+
run: |
99+
docker tag velog-dashboard-v2-fe:latest ${{ secrets.DOCKER_USERNAME }}/velog-dashboard-v2-fe:latest
100+
docker push ${{ secrets.DOCKER_USERNAME }}/velog-dashboard-v2-fe:latest
101+
102+
docker-deploy:
103+
runs-on: ubuntu-latest
104+
needs: build-and-test
105+
# 하나의 버전이라도 성공하면 실행 (일부 실패해도 진행)
106+
if: ${{ !cancelled() && contains(needs.build-and-test.result, 'success') }}
107+
108+
steps:
109+
- name: Checkout repository
110+
uses: actions/checkout@v4
111+
112+
# Docker 로그인
113+
- name: Log in to Docker Hub
114+
uses: docker/login-action@v3
115+
with:
116+
username: ${{ secrets.DOCKER_USERNAME }}
117+
password: ${{ secrets.DOCKER_PASSWORD }}
118+
119+
# Docker 이미지 빌드
120+
- name: Build Docker Image
121+
run: |
122+
docker build -t velog-dashboard-v2-api:latest .
123+
124+
# Docker Hub에 푸시
125+
- name: Push Docker Image
126+
run: |
127+
docker tag velog-dashboard-v2-api:latest ${{ secrets.DOCKER_USERNAME }}/velog-dashboard-v2-api:latest
128+
docker push ${{ secrets.DOCKER_USERNAME }}/velog-dashboard-v2-api:latest

0 commit comments

Comments
 (0)