-
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.
Mafia-together ver 2.0 prod deploy (#154)
* feat : 서버 api 요청 주소 변경 * chore : dev cicd 파이프라인 작성 * chore : dev CI/CD 파이프라인 수정 * chore : prod CI/CD 작성 * refactor: 채팅을 웹소켓으로 교체한다 (#138) * fix: 새로고침하면 본인 직업이 날라가는 문제 해결 (#140) * fix: 새로고침 할때 가끔 채팅구독이 안되는 문제 해결 (#142) 연결될때 useState를 변경해서 구독을 트리거 함 * feat: 대기방 정보 SSE로 교체 (#144) * feat: 대기방 정보 SSE로 교체 * chore: 사용안하는 코드 및 log제거 * feat: 마피아 스킬을 웹소켓으로 교체 (#146) * Feature/148 채팅에서 직업 보여주기 (#150) * chore: 글씨 제거 * feat: 채팅에서 직업 찾아서 보여주기 * Feature/#147 깃허브 액션에 env 추가 (#151) * feat: 초대코드 도메인 두번 들어가는 형상 제거 * feat: 웹소켓 baseURL에 도메인 변수를 활용하도록 수정 * feat: 도메인 상수를 env를 활용하도록 수정 * feat: 깃허브 액션에 env 추가 * fix: 마피아일 때 기존 타켓 요청이 안가는 버그 수정 --------- Co-authored-by: waterricecake <[email protected]> Co-authored-by: waterricecake <[email protected]>
- Loading branch information
1 parent
c58808c
commit 9e3074f
Showing
22 changed files
with
458 additions
and
133 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
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,36 @@ | ||
name: Dev CI/CD | ||
|
||
on: | ||
push: | ||
branches: [dev] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: | ||
group: Default | ||
labels: [self-hosted, dev] | ||
permissions: | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run build | ||
run: npm run build | ||
env: | ||
VITE_DOMAIN: ${{ secrets.VITE_DOMAIN_DEV }} | ||
|
||
- name: 빌드 파일 | ||
run: cp -rf ./dist ~/ |
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,42 @@ | ||
name: Prod CI/CD | ||
|
||
on: | ||
push: | ||
branches: [prod] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: | ||
group: Default | ||
labels: [self-hosted, dev] | ||
permissions: | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run build | ||
run: npm run build | ||
env: | ||
VITE_DOMAIN: ${{ secrets.VITE_DOMAIN_PROD }} | ||
|
||
- name: Copy to Prod Server | ||
uses: appleboy/scp-action@master | ||
with: | ||
username: ${{ secrets.PROD_USER_NAME }} | ||
host: ${{ secrets.PROD_SERVER }} | ||
key: ${{ secrets.PROD_PEM_KEY }} | ||
source: './dist' | ||
target: '~/' |
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 |
---|---|---|
|
@@ -25,4 +25,5 @@ dist-ssr | |
*.sw? | ||
|
||
# env | ||
.env.development | ||
.env | ||
.env.development |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,45 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import { css } from '@emotion/react'; | ||
import { useRecoilState } from 'recoil'; | ||
|
||
import { roomInfoState } from '../../recoil/roominfo/atom'; | ||
import { VariablesCSS } from '../../styles/VariablesCSS'; | ||
import { ChatArray } from '../../type'; | ||
import { ChatForm } from './ChatForm'; | ||
import { Chats } from './Chats'; | ||
|
||
type PropsType = { | ||
publishChat: (content: string) => void; | ||
chats: ChatArray; | ||
setChats: React.Dispatch<React.SetStateAction<ChatArray>>; | ||
}; | ||
|
||
export const Chat = ({ publishChat, chats, setChats }: PropsType) => { | ||
/* 방 정보 */ | ||
const [roomInfo] = useRecoilState(roomInfoState); | ||
|
||
// 내가 살아있는지 | ||
const isAlive = roomInfo?.isAlive; | ||
|
||
return ( | ||
<> | ||
{/* 채팅목록 */} | ||
<div css={middle}> | ||
<Chats chats={chats} setChats={setChats} /> | ||
</div> | ||
|
||
{/* 살아있는 경우에만 input창이 보인다. */} | ||
{isAlive && <ChatForm publishChat={publishChat} />} | ||
</> | ||
); | ||
}; | ||
|
||
const middle = css` | ||
height: calc(100% - ${VariablesCSS.top} - 55px - 20px); | ||
overflow: scroll; | ||
-ms-overflow-style: none; | ||
scrollbar-width: none; | ||
&::-webkit-scrollbar { | ||
display: none; | ||
} | ||
`; |
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.