Skip to content

Handle case-insensitive API response fields in pending order cancella… #38

Handle case-insensitive API response fields in pending order cancella…

Handle case-insensitive API response fields in pending order cancella… #38

Workflow file for this run

name: Deploy to GHCR
on:
push:
branches: [ production ]
release:
types: [ published ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false # 하나 실패해도 다른 것은 계속 진행
matrix:
include:
- image: api
dockerfile: ./Dockerfile.api
suffix: ""
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Verify Dockerfile exists
run: |
echo "Checking for Dockerfile: ${{ matrix.dockerfile }}"
ls -la ${{ matrix.dockerfile }}
echo "Context files:"
ls -la .
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.suffix }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=production,enable=${{ startsWith(github.ref, 'refs/heads/production') }}
- name: Build and push ${{ matrix.image }} Docker image
id: build
timeout-minutes: 30 # 30분 타임아웃 설정
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.image }}
cache-to: type=gha,mode=max,scope=${{ matrix.image }}
platforms: linux/amd64,linux/arm64
provenance: false # Provenance 비활성화로 빌드 속도 향상
# Attestation 단계 제거 - OIDC 권한 이슈로 인해 주석 처리
# - name: Generate artifact attestation for ${{ matrix.image }}
# if: success()
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}${{ matrix.suffix }}
# subject-digest: ${{ steps.build.outputs.digest }}
# push-to-registry: true
# continue-on-error: true
- name: Build Summary
if: always()
run: |
echo "## Build Summary for ${{ matrix.image }}" >> $GITHUB_STEP_SUMMARY
echo "- **Image**: ${{ matrix.image }}" >> $GITHUB_STEP_SUMMARY
echo "- **Dockerfile**: ${{ matrix.dockerfile }}" >> $GITHUB_STEP_SUMMARY
echo "- **Status**: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.build.outcome }}" == "success" ]; then
echo "- **Image pushed**: ✅" >> $GITHUB_STEP_SUMMARY
echo "- **Tags**: ${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
else
echo "- **Image pushed**: ❌" >> $GITHUB_STEP_SUMMARY
fi