This repository was archived by the owner on Jul 13, 2026. It is now read-only.
๐ fix: API response ๋ฐฉ์ ๋ณ๊ฒฝ ์ฌํญ ๋ฐ์ #24
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 }}" |