-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
46 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- 'packages/user/**' | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out The Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Deploy to xquare | ||
uses: team-xquare/xquare-deployment-action@master | ||
with: | ||
environment: prod | ||
access_key: ${{ secrets.ACCESS_KEY }} | ||
base_url: packages/user | ||
config_file_path: packages/user/.xquare/config.yaml | ||
buildargs: | | ||
BRANCH=dev | ||
VITE_MAIN_URL=${{ secrets.PROD_VITE_MAIN_URL }} | ||
VITE_SERVER_URL=${{ secrets.PROD_VITE_SERVER_URL }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
VITE_MAIN_URL=sillok.xquare.app | ||
VITE_SERVER_URL=sillok-stag-server.xquare.app | ||
PROD_VITE_MAIN_URL=sillok.xquare.app | ||
PROD_VITE_SERVER_URL=sillok-stag-server.xquare.app |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ node_modules | |
dist | ||
dist-ssr | ||
*.local | ||
.env | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,40 @@ | ||
# 빌드 단계 | ||
FROM node:22-alpine AS builder | ||
|
||
# 필요한 패키지 설치 | ||
RUN apk add --no-cache libc6-compat git curl unzip | ||
RUN apk add --no-cache libc6-compat git curl unzip file | ||
|
||
# 환경 변수 설정 | ||
# ARG와 ENV 설정 | ||
ARG VITE_MAIN_URL | ||
ARG VITE_SERVER_URL | ||
ARG BRANCH=main | ||
|
||
ENV VITE_MAIN_URL=${VITE_MAIN_URL} | ||
ENV VITE_SERVER_URL=${VITE_SERVER_URL} | ||
|
||
# 브랜치 설정 | ||
ARG BRANCH | ||
ENV BRANCH=${BRANCH} | ||
|
||
# GitHub 저장소에서 소스 다운로드 및 압축 해제 | ||
RUN curl -L -o ../Sillok_FE.zip https://github.com/Team-jeong-ho-kim/Sillok_FE/archive/${BRANCH}.zip && \ | ||
unzip ../Sillok_FE.zip -d / | ||
|
||
# Yarn 설정 | ||
RUN corepack enable && corepack prepare [email protected] --activate | ||
# 파일 다운로드 및 압축 해제 | ||
RUN echo "Downloading from: https://github.com/Team-jeong-ho-kim/Sillok_FE/archive/refs/heads/${BRANCH}.zip" && \ | ||
curl -L -o ../Sillok_FE.zip https://github.com/Team-jeong-ho-kim/Sillok_FE/archive/refs/heads/${BRANCH}.zip && \ | ||
unzip ../Sillok_FE.zip -d / && \ | ||
ls -l / && \ | ||
ls -l /Sillok_FE-${BRANCH} | ||
|
||
# 작업 디렉토리 변경 | ||
# Yarn 설정 및 빌드 | ||
WORKDIR /Sillok_FE-${BRANCH} | ||
|
||
# Yarn Berry 버전 사용 | ||
RUN corepack enable && corepack prepare [email protected] --activate | ||
RUN yarn set version berry | ||
RUN yarn install | ||
|
||
# 특정 패키지 경로로 이동 후 빌드 | ||
# 패키지 디렉터리 확인 | ||
WORKDIR /Sillok_FE-${BRANCH}/packages/user | ||
RUN yarn build | ||
RUN ls -l && yarn build | ||
|
||
# 실행 단계 | ||
FROM nginx:alpine AS runner | ||
|
||
# 브랜치 환경 변수 설정 | ||
ARG BRANCH | ||
ENV BRANCH=${BRANCH} | ||
|
||
# Nginx 설정 파일 작성 | ||
RUN echo "\ | ||
server {\ | ||
listen 3000;\ | ||
|
@@ -51,11 +45,8 @@ server {\ | |
}\ | ||
}" > /etc/nginx/conf.d/default.conf | ||
|
||
# 빌드 결과물 복사 | ||
COPY --from=builder /Sillok_FE-${BRANCH}/packages/user/build /usr/share/nginx/html | ||
COPY --from=builder /Sillok_FE-${BRANCH}/packages/user/dist /usr/share/nginx/html | ||
|
||
# 포트 노출 | ||
EXPOSE 3000 | ||
|
||
# Nginx 실행 | ||
CMD ["nginx", "-g", "daemon off;"] |