This repository was archived by the owner on Jul 13, 2026. It is now read-only.
Merge branch 'refactor/notice' into dev-merge_test #27
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: Deploy Frontend (Docker) | |
| on: | |
| push: | |
| branches: ['dev-merge_test'] # 원하는 브랜치로 변경 가능 | |
| release: | |
| types: ['published'] | |
| jobs: | |
| build-push-docker: | |
| runs-on: ubuntu-latest | |
| env: | |
| IMAGE_NAME: gsc-portal-frontend | |
| DOCKERHUB_USERNAME: sgwar | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Node.js 설치 (frontend 빌드용) | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| # .env.production 생성 | |
| - name: Create .env.production | |
| run: | | |
| echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" >> .env.production | |
| echo "VITE_ENV=production" >> .env.production | |
| # 의존성 설치 | |
| - name: Install dependencies | |
| run: npm ci | |
| # 프론트엔드 빌드 | |
| - name: Build frontend | |
| run: npm run build -- --mode production | |
| # ------------------------------- | |
| # Docker 이미지를 빌드 & 푸시 | |
| # ------------------------------- | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # image tag 구성 | |
| - name: Extract Git metadata | |
| id: vars | |
| run: | | |
| echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| sgwar/gsc-portal-frontend:latest | |
| sgwar/gsc-portal-frontend:${{ env.BRANCH }}-${{ env.SHORT_SHA }} | |
| file: ./Dockerfile | |
| - name: Deployment completed | |
| run: | | |
| echo "🚀 FRONTEND Docker image pushed!" | |
| echo "📦 sgwar/gsc-portal-frontend:${{ env.BRANCH }}-${{ env.SHORT_SHA }}" |