Skip to content
Merged
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
22 changes: 8 additions & 14 deletions .github/workflows/ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y jq

# 멀티아치 에뮬레이션(QEMU) 세팅
# GitHub Actions의 amd64 러너에서 Graviton(arm64) 이미지를 빌드하기 위한 QEMU 세팅
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
platforms: arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -53,7 +53,7 @@ jobs:
id: tag
run: echo "TAG=${GITHUB_SHA::12}" >> $GITHUB_OUTPUT

- name: Build & Push multi-arch image
- name: Build & Push ARM64 image
id: build
run: |
set -e
Expand All @@ -63,15 +63,15 @@ jobs:
LATEST_URI="$REGISTRY/${{ env.ECR_REPOSITORY }}:latest"

docker buildx build \
--platform linux/amd64,linux/arm64 \
--platform linux/arm64 \
--push \
--tag "$IMAGE_URI" \
--tag "$LATEST_URI" \
.

echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_OUTPUT

- name: Verify multi-arch manifest (Fixed)
- name: Verify ARM64 manifest
run: |
set -e
REGISTRY="${{ steps.ecr.outputs.registry }}"
Expand All @@ -83,19 +83,13 @@ jobs:
echo "$ARCHES"

# 정확한 매칭으로 수정
if ! echo "$ARCHES" | grep -x 'linux/amd64' > /dev/null; then
echo "❌ Missing linux/amd64 in manifest"
echo "Available platforms: $ARCHES"
exit 1
fi

if ! echo "$ARCHES" | grep -x 'linux/arm64' > /dev/null; then
echo "❌ Missing linux/arm64 in manifest"
echo "Available platforms: $ARCHES"
exit 1
fi

echo "✅ Both linux/amd64 and linux/arm64 found"
echo "✅ linux/arm64 found"

# repository_dispatch 전송 + HTTP 204 확인
- name: Trigger ECS/EC2 Deploy via repository_dispatch
Expand Down Expand Up @@ -125,10 +119,10 @@ jobs:

- name: Summary
run: |
echo "### ✅ ECR Push & Dispatch OK (Multi-arch)" >> $GITHUB_STEP_SUMMARY
echo "### ✅ ECR Push & Dispatch OK (ARM64)" >> $GITHUB_STEP_SUMMARY
echo "- Repo: \`${{ env.ECR_REPOSITORY }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Tag: \`${{ steps.tag.outputs.TAG }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Image: \`${{ steps.build.outputs.IMAGE_URI }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Arches: \`linux/amd64, linux/arm64\`" >> $GITHUB_STEP_SUMMARY
echo "- Arch: \`linux/arm64\`" >> $GITHUB_STEP_SUMMARY
# echo "- Sent: \`repository_dispatch: deploy-ecs\`" >> $GITHUB_STEP_SUMMARY
echo "- Sent: \`repository_dispatch: deploy-ec2\`" >> $GITHUB_STEP_SUMMARY
Loading