[AI] [FIX] infer_input_shape_from_legacy_h5() 메서드 추가 (#333) #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Deploy XAI (Dev) | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - "AI/**" # ⬅ xai만 말고 AI 전체 감시 (Dockerfile 포함) | |
| - ".github/workflows/xai-job.yml" | |
| concurrency: | |
| group: deploy-xai-main | |
| cancel-in-progress: true | |
| env: | |
| IMAGE_XAI: ghcr.io/sisc-it/sisc-web-xai | |
| jobs: | |
| build-xai: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & Push (xai) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./AI # ⬅ AI 디렉토리 전체를 컨텍스트로 | |
| file: ./AI/Dockerfile # ⬅ Dockerfile 위치 | |
| push: true | |
| platforms: linux/amd64 | |
| tags: ${{ env.IMAGE_XAI }}:latest | |
| #cache-from: type=gha | |
| #cache-to: type=gha,mode=max | |
| deploy-xai: | |
| needs: [build-xai] | |
| if: ${{ github.event_name == 'workflow_dispatch' || needs.build-xai.result == 'success' }} | |
| runs-on: ubuntu-latest | |
| environment: development | |
| steps: | |
| - name: SSH deploy (pull latest XAI image on development) | |
| uses: appleboy/ssh-action@v1.2.0 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT || 22 }} | |
| script_stop: true | |
| command_timeout: 30m | |
| script: | | |
| set -euo pipefail | |
| IMAGE="ghcr.io/sisc-it/sisc-web-xai:latest" | |
| IMAGE_REPO="ghcr.io/sisc-it/sisc-web-xai" | |
| echo "${{ secrets.GHCR_READ_TOKEN }}" | docker login ghcr.io -u ${{ secrets.GHCR_READ_USER }} --password-stdin | |
| docker pull "$IMAGE" | |
| CURRENT_IMAGE_ID="$(docker image inspect "$IMAGE" --format '{{.Id}}')" | |
| docker image ls --no-trunc --format '{{.Repository}}:{{.Tag}} {{.ID}}' "$IMAGE_REPO" | while read -r image_ref image_id; do | |
| [ -n "$image_ref" ] || continue | |
| [ -n "$image_id" ] || continue | |
| if [ "$image_id" != "$CURRENT_IMAGE_ID" ]; then | |
| docker rmi -f "$image_id" >/dev/null 2>&1 || true | |
| fi | |
| done | |
| docker image prune -f >/dev/null 2>&1 || true |