Skip to content

Commit 10fc3ed

Browse files
authored
Merge pull request #2 from boostcampwm-2024/feat/#1/media-build
[Feat] dockerfile 캐싱을 통한 빌드 시간 단축
2 parents 1e8a4bd + d010604 commit 10fc3ed

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/back-media-cd.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,21 @@ jobs:
5959
username: ${{secrets.DOCKER_REGISTRY_ACCESS_KEY}}
6060
password: ${{secrets.DOCKER_REGISTRY_SECRET_KEY}}
6161

62-
- name: 🐳 Docker 빌드 및 푸시
63-
run: docker buildx build -f apps/media/Dockerfile . -t ${{secrets.DOCKER_REGISTRY_URL}}/media:${{ github.sha }} -t ${{secrets.DOCKER_REGISTRY_URL}}/media:latest --push
6462

65-
deploy:
63+
- name: Set up Docker Buildx
64+
uses: docker/setup-buildx-action@v3
65+
66+
- name: 🐳 Docker 빌드 및 푸시
67+
uses: docker/build-push-action@v6
68+
with:
69+
context: .
70+
file: apps/media/Dockerfile
71+
push: true
72+
tags: ${{secrets.DOCKER_REGISTRY_URL}}/media:${{ github.sha }},${{secrets.DOCKER_REGISTRY_URL}}/media:latest
73+
cache-from: type=gha
74+
cache-to: type=gha,mode=min
75+
76+
deploy-test:
6677
needs: build
6778
name: Deploy media
6879
runs-on: [ticle-main]

apps/media/.Dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ./apps/web 디렉토리 제외
2+
apps/web

0 commit comments

Comments
 (0)