Skip to content

Commit

Permalink
🌐 [Ci]: base 이미지 캐싱
Browse files Browse the repository at this point in the history
  • Loading branch information
seungheon123 committed Nov 30, 2024
1 parent 94ee16d commit 8ec8a85
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/media-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ on:
push:
branches:
- develop
paths:
- 'apps/media/**'
- Fix/316
# paths:
# - 'apps/media/**'

jobs:
build-and-push:
Expand Down Expand Up @@ -36,28 +37,18 @@ jobs:
run: |
echo "$PASSWORD" | docker login -u "$USERNAME" "$REGISTRY_URL" --password-stdin
- name: Build Docker image
run: |
docker build \
--cache-from=${{ secrets.NCLOUD_REGISTRY_URL }}/$IMAGE_NAME:latest \
-f ./apps/media/Dockerfile \
-t ${{ secrets.NCLOUD_REGISTRY_URL }}/$IMAGE_NAME:latest \
--build-arg MEDIA_PORT=$MEDIA_PORT \
--build-arg REDIS_HOST=$REDIS_HOST \
--build-arg REDIS_PORT=$REDIS_PORT \
--build-arg REDIS_MEDIA=$REDIS_MEDIA \
--build-arg ANNOUNCED_IP=$ANNOUNCED_IP \
--build-arg API_SERVER_URL=$API_SERVER_URL \
--build-arg HTTP_TIMEOUT=$HTTP_TIMEOUT \
--build-arg RECORD_SERVER_URL=$RECORD_SERVER_URL \
--build-arg SERVER_PRIVATE_IP=$SERVER_PRIVATE_IP \
--build-arg PUBLIC_RECORD_SERVER_URL=$PUBLIC_RECORD_SERVER_URL \
--build-arg JWT_SECRET=$JWT_SECRET \
.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Push to Ncloud Container Registry
run: |
docker push ${{ secrets.NCLOUD_REGISTRY_URL }}/$IMAGE_NAME:latest
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./apps/media/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ secrets.NCLOUD_REGISTRY_URL }}/media-camon:latest

deploy-and-run:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8ec8a85

Please sign in to comment.