-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge branch 'develop' into feature/#141
- Loading branch information
Showing
19 changed files
with
352 additions
and
106 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 |
---|---|---|
|
@@ -39,41 +39,26 @@ jobs: | |
working-directory: ./client | ||
run: pnpm test | true | ||
|
||
deploy: | ||
needs: ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: '9' | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build Core Package | ||
working-directory: ./core | ||
run: pnpm build | ||
|
||
- name: Build Client | ||
working-directory: ./client | ||
env: | ||
VITE_API_URL: ${{secrets.VITE_API_URL}} | ||
VITE_SOCKET_URL: ${{secrets.VITE_SOCKET_URL}} | ||
run: pnpm build | ||
|
||
- name: Upload to Object Storage | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.NCP_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.NCP_SECRET_KEY }} | ||
run: | | ||
aws s3 sync ./client/dist s3://${{ secrets.NCP_BUCKET }}/ \ | ||
--endpoint-url https://kr.object.ncloudstorage.com \ | ||
--region kr-standard | ||
deploy: | ||
needs: ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to Server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: mira | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
script: | | ||
cd /home/mira/web30-stop-troublepainter | ||
git pull origin develop | ||
docker compose build nginx | ||
docker compose up -d nginx |
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
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
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,18 @@ | ||
FROM node:20-alpine AS builder | ||
|
||
RUN corepack enable && corepack prepare [email protected] --activate | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN pnpm install --frozen-lockfile && pnpm build | ||
|
||
FROM nginx:alpine | ||
|
||
COPY nginx.conf /etc/nginx/templates/default.conf.template | ||
COPY --from=builder /app/client/dist /usr/share/nginx/html | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
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
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
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,48 @@ | ||
import { useEffect } from 'react'; | ||
import { PlayerRole } from '@troublepainter/core'; | ||
import { Modal } from '../ui/Modal'; | ||
import { useModal } from '@/hooks/useModal'; | ||
import { useGameSocketStore } from '@/stores/socket/gameSocket.store'; | ||
|
||
const RoundEndModal = () => { | ||
const { room, roundWinner, players, timers } = useGameSocketStore(); | ||
const { isModalOpened, openModal, closeModal } = useModal(); | ||
|
||
useEffect(() => { | ||
if (roundWinner) openModal(); | ||
}, [roundWinner]); | ||
|
||
useEffect(() => { | ||
if (timers.ENDING === 0) closeModal(); | ||
}, [timers.ENDING]); | ||
|
||
const devil = players.find((player) => player.role === PlayerRole.DEVIL); | ||
|
||
return ( | ||
<Modal | ||
title={room?.currentWord || ''} | ||
isModalOpened={isModalOpened} | ||
className="max-w-[26.875rem] sm:max-w-[61.75rem]" | ||
> | ||
<div className="flex min-h-[12rem] items-center justify-center sm:min-h-[15.75rem]"> | ||
<p className="text-center text-2xl sm:m-2 sm:text-3xl"> | ||
{roundWinner?.role === PlayerRole.DEVIL ? ( | ||
<> 정답을 맞춘 구경꾼이 없습니다</> | ||
) : ( | ||
<> | ||
구경꾼 <span className="text-violet-600">{roundWinner?.nickname}</span>이 정답을 맞혔습니다 | ||
</> | ||
)} | ||
</p> | ||
</div> | ||
<div className="min-h-[4rem] rounded-md bg-violet-50 p-4 sm:m-2"> | ||
<p className="text-center text-xl text-violet-950 sm:text-2xl"> | ||
방해꾼은 <span className="text-violet-600">{devil?.nickname}</span>였습니다. | ||
</p> | ||
<span>{timers.ENDING}</span> {/* 임시 */} | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default RoundEndModal; |
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
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
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
Oops, something went wrong.