Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Dev Frontend Build and Test
name: Build Frontend - Dev

on:
push:
pull_request:
branches: [ dev ]
paths:
- 'frontend/**'
- '.github/workflows/dev-frontend.yml'
- '.github/workflows/build-frontend-dev.yml'
workflow_dispatch: # 수동 실행 버튼 활성화
inputs:
force_build_all:
Expand All @@ -17,7 +17,6 @@ on:
jobs:
# 변경된 앱 감지
detect-changes:
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.force_build_all == 'false')
runs-on: ubuntu-24.04
outputs:
admin-changed: ${{ steps.changes.outputs.admin }}
Expand All @@ -28,14 +27,11 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2 # 이전 커밋과 비교하기 위해

- name: Detect changes
uses: dorny/paths-filter@v3
id: changes
with:
base: HEAD~1
filters: |
admin:
- 'frontend/apps/admin/**'
Expand All @@ -48,31 +44,17 @@ jobs:

# Admin 앱 빌드 및 테스트
build-admin:
needs: [detect-changes]
needs: detect-changes
if: |
always() && (
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build_all == 'true') ||
(needs.detect-changes.result == 'success' && (needs.detect-changes.outputs.admin-changed == 'true' || needs.detect-changes.outputs.packages-changed == 'true')) ||
needs.detect-changes.result == 'skipped'
)
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build_all == 'true') ||
needs.detect-changes.outputs.admin-changed == 'true' ||
needs.detect-changes.outputs.packages-changed == 'true'
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'

- name: Install dependencies
run: |
cd frontend
npm ci --include-workspace-root --workspaces

- name: Build Admin App
run: |
cd frontend
Expand Down Expand Up @@ -115,31 +97,17 @@ jobs:

# Contents 앱 빌드 및 테스트
build-contents:
needs: [detect-changes]
needs: detect-changes
if: |
always() && (
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build_all == 'true') ||
(needs.detect-changes.result == 'success' && (needs.detect-changes.outputs.contents-changed == 'true' || needs.detect-changes.outputs.packages-changed == 'true')) ||
needs.detect-changes.result == 'skipped'
)
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build_all == 'true') ||
needs.detect-changes.outputs.contents-changed == 'true' ||
needs.detect-changes.outputs.packages-changed == 'true'
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'

- name: Install dependencies
run: |
cd frontend
npm ci --include-workspace-root --workspaces

- name: Build Contents App
run: |
cd frontend
Expand Down Expand Up @@ -182,31 +150,17 @@ jobs:

# Seller 앱 빌드 및 테스트
build-seller:
needs: [detect-changes]
needs: detect-changes
if: |
always() && (
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build_all == 'true') ||
(needs.detect-changes.result == 'success' && (needs.detect-changes.outputs.seller-changed == 'true' || needs.detect-changes.outputs.packages-changed == 'true')) ||
needs.detect-changes.result == 'skipped'
)
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build_all == 'true') ||
needs.detect-changes.outputs.seller-changed == 'true' ||
needs.detect-changes.outputs.packages-changed == 'true'
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'

- name: Install dependencies
run: |
cd frontend
npm ci --include-workspace-root --workspaces

- name: Build Seller App
run: |
cd frontend
Expand Down Expand Up @@ -284,7 +238,9 @@ jobs:
fi

echo ""
echo "🎯 빌드 트리거: ${{ github.event_name }}"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "🎯 빌드 트리거: Manual Dispatch"
echo "🔧 강제 전체 빌드: ${{ github.event.inputs.force_build_all }}"
else
echo "🎯 빌드 트리거: Pull Request to dev branch"
fi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: PR Frontend Build and Push
name: Build Frontend - Main

on:
pull_request:
branches: [ main ]
paths:
- 'frontend/**'
- '.github/workflows/pr-frontend.yml'
- '.github/workflows/build-frontend.yml'

env:
ECR_REGISTRY: public.ecr.aws/x2l9m6x8/selfscape/moimjang
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ jobs:
docker run -d \
--name moimjang-frontend-contents \
--restart unless-stopped \
-p 3132:3000 \
-p 3133:3000 \
${{ env.ECR_REGISTRY }}-contents:$IMAGE_TAG
echo "✅ New contents container started successfully"

- name: Health Check Contents App
run: |
echo "🔍 Performing health check for contents app..."
sleep 10
if curl -f http://localhost:3132 > /dev/null 2>&1; then
if curl -f http://localhost:3133 > /dev/null 2>&1; then
echo "✅ Contents app is healthy and responding"
else
echo "❌ Contents app health check failed"
Expand Down Expand Up @@ -195,15 +195,15 @@ jobs:
docker run -d \
--name moimjang-frontend-seller \
--restart unless-stopped \
-p 3133:3000 \
-p 3132:3000 \
${{ env.ECR_REGISTRY }}-seller:$IMAGE_TAG
echo "✅ New seller container started successfully"

- name: Health Check Seller App
run: |
echo "🔍 Performing health check for seller app..."
sleep 10
if curl -f http://localhost:3133 > /dev/null 2>&1; then
if curl -f http://localhost:3132 > /dev/null 2>&1; then
echo "✅ Seller app is healthy and responding"
else
echo "❌ Seller app health check failed"
Expand Down
17 changes: 17 additions & 0 deletions backend/webapp/repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,23 @@ def is_object_exists(self, object_key: str, file_size: int) -> bool:
except S3Error:
return False

def get_presigned_url(
self, object_key: str, expires: timedelta = timedelta(days=1)
) -> str:
try:
stat = self.client.stat_object(self.bucket_name, object_key)
content_type = stat.content_type
response_headers = {"response-content-type": content_type}
return self.client.presigned_get_object(
self.bucket_name,
object_key,
expires=expires,
response_headers=response_headers, # type: ignore
)
except S3Error as e:
logger.error(f"Failed to generate presigned URL: {str(e)}")
return ""

def get_img_proxy_url(self, object_path: str) -> str:
"""
S3 오브젝트 경로를 이미지 프록시 URL로 변환합니다.
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/contents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"eslint-config-next": "15.1.8",
"typescript": "^5"
}
}
}