Skip to content

Commit

Permalink
Merge pull request #227 from TEAM-MONGDOL/develop
Browse files Browse the repository at this point in the history
[merge] main <- develop
  • Loading branch information
MinhoJJang authored Aug 14, 2024
2 parents 61d38d8 + 6f37a8d commit ae9904e
Show file tree
Hide file tree
Showing 29 changed files with 213 additions and 131 deletions.
59 changes: 33 additions & 26 deletions .github/workflows/nextjs-prod-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -27,31 +26,39 @@ jobs:
echo "tag=$latest_tag" >> $GITHUB_OUTPUT
fi
- name: Deploy to Web Servers
env:
BASTION_IP: ${{ secrets.BASTION_IP }}
USER: ${{ secrets.BASTION_USER }}
SSH_KEY: ${{ secrets.SSH_KEY }}
KCR_USERNAME: ${{ secrets.ACCESS_KEY }}
KCR_PASSWORD: ${{ secrets.ACCESS_SECRET_KEY }}
WEB_IPS: ${{ secrets.WEB_IPS }}
DEPLOY_TAG: ${{ steps.get_tag.outputs.tag }}
run: |
echo "$SSH_KEY" > ssh_key
chmod 600 ssh_key
ssh -i ssh_key -o StrictHostKeyChecking=no $USER@$BASTION_IP << 'EOF'
IFS=',' read -ra WEB_IP_ARRAY <<< "$WEB_IPS"
for WEB_IP in "${WEB_IP_ARRAY[@]}"; do
ssh -i ssh_key -o StrictHostKeyChecking=no $USER@$WEB_IP << 'ENDSSH'
echo $KCR_PASSWORD | docker login dkation.kr-central-2.kcr.dev -u $KCR_USERNAME --password-stdin
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: Deploy to FE
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.BASTION_HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.SSH_KEY }}
script: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
IFS=',' read -r -a HOSTS <<< "${{ secrets.WEB_IPS }}"
for host in "${HOSTS[@]}"
do
echo "$host"
ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ubuntu@$host << EOF
echo "Stopping and removing existing containers"
docker ps -q --filter ancestor=dkation.kr-central-2.kcr.dev/dkation-prod-front/dkation-prod-fe | xargs -r docker stop
docker ps -aq --filter ancestor=dkation.kr-central-2.kcr.dev/dkation-prod-front/dkation-prod-fe | xargs -r docker rm
echo "Removing old Docker images"
docker images dkation.kr-central-2.kcr.dev/dkation-prod-front/dkation-prod-fe --format '{{.ID}}' | xargs -r docker rmi
docker pull dkation.kr-central-2.kcr.dev/dkation-prod-front/dkation-prod-fe:${DEPLOY_TAG}
docker run -d -p 80:3000 dkation.kr-central-2.kcr.dev/dkation-prod-front/dkation-prod-fe:${DEPLOY_TAG}
ENDSSH
done
EOF
rm ssh_key
echo "Login to KCR"
docker login dkation.kr-central-2.kcr.dev --username ${{ secrets.ACCESS_KEY }} --password ${{ secrets.ACCESS_SECRET_KEY }}
echo "Pulling new Docker image"
docker pull dkation.kr-central-2.kcr.dev/dkation-prod-front/dkation-prod-fe:${{ steps.get_tag.outputs.tag }}
echo "Running new Docker container"
docker run -d -p 80:3000 dkation.kr-central-2.kcr.dev/dkation-prod-front/dkation-prod-fe:${{ steps.get_tag.outputs.tag }}
EOF
done
2 changes: 2 additions & 0 deletions .github/workflows/nextjs-prod-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
NEXT_PUBLIC_SERVER_URL: ${{ secrets.NEXT_PUBLIC_SERVER_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
NEXT_PUBLIC_KAKAO_API_KEY: ${{ secrets.NEXT_PUBLIC_KAKAO_API_KEY }}

- name: Get latest tag and create new tag
id: create_tag
Expand Down Expand Up @@ -102,6 +103,7 @@ jobs:
NEXT_PUBLIC_SERVER_URL=${{ secrets.NEXT_PUBLIC_SERVER_URL }}
NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }}
NEXT_PUBLIC_KAKAO_API_KEY: ${{ secrets.NEXT_PUBLIC_KAKAO_API_KEY }}
- name: Create Release
uses: actions/create-release@v1
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ WORKDIR /app
ARG NEXT_PUBLIC_SERVER_URL
ARG NEXTAUTH_SECRET
ARG NEXTAUTH_URL
ARG NEXT_PUBLIC_KAKAO_API_KEY

ENV NEXT_PUBLIC_SERVER_URL=${NEXT_PUBLIC_SERVER_URL}
ENV NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
ENV NEXTAUTH_URL=${NEXTAUTH_URL}
ARG NEXT_PUBLIC_KAKAO_API_KEY=${NEXT_PUBLIC_KAKAO_API_KEY}

# Set node environment to production
ENV NODE_ENV=production
Expand Down
1 change: 1 addition & 0 deletions next-auth.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ declare module 'next-auth' {
accessToken: string;
accountId: number;
isAdmin: boolean;
expiredAt: number;
}
}
2 changes: 1 addition & 1 deletion src/app/(route)/(user)/(with-layout)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Userlayout = ({ children }: Props) => {
return (
<div>
<UserNavBarContainer />
<main className="mb-20 flex-1 overflow-y-auto">{children}</main>
<main className="mb-20 min-h-screen flex-1">{children}</main>
<UserFooterContainer />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const UserWkHistoryPage = () => {
<WorkationCard
applyId={wkt.applyId}
accountId={accountId}
reviewId={wkt.reviewId}
key={wkt.wktId}
wktId={wkt.wktId}
thumbnailUrl={wkt.thumbnailUrl}
Expand All @@ -212,7 +213,7 @@ const UserWkHistoryPage = () => {
endDate={wkt.endDate}
bettingPoint={wkt.bettingPoint}
applyStatusType={wkt.applyStatusType}
waitingNumber={4} // 수정 필요
waitingNumber={wkt.waitNumber} // 수정 필요
onClick={() => handleCardClick(wkt.applyStatusType, wkt.wktId)}
/>
))
Expand Down
1 change: 1 addition & 0 deletions src/app/(route)/(user)/(with-layout)/support/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const UserSupportLayout = ({ children }: Props) => {
{
text: '공지사항',
path: '/support/notices',
parent: '/support/notices',
},
{
text: '자주 묻는 질문',
Expand Down
13 changes: 8 additions & 5 deletions src/app/(route)/(user)/(with-layout)/support/notices/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ const UserNoticePage = () => {
<UserTableBodyModule key={item.id}>
<UserTableBodyAtom isFirst>{index + 1}</UserTableBodyAtom>
<UserTableBodyAtom>
<UserTextLabelAtom
text={noticeTypeConverter[item.announcementType]}
size="sm"
className={getCategoryStyle(item.announcementType)}
/>
<div className="flex items-center justify-center">
<UserTextLabelAtom
text={noticeTypeConverter[item.announcementType]}
size="sm"
className={getCategoryStyle(item.announcementType)}
/>
</div>
</UserTableBodyAtom>
<UserTableBodyAtom>{item.title}</UserTableBodyAtom>
<UserTableBodyAtom>
Expand All @@ -161,6 +163,7 @@ const UserNoticePage = () => {
{data && data.pageInfo.totalElements > 0 && (
<div className="mt-40 flex justify-center">
<PaginationModule
user
currentPage={currentPage}
setCurrentPage={setCurrentPage}
totalPages={data.pageInfo.totalPages}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,23 @@ const UserWkApplyPage = ({ params }: Props) => {
return (
<section>
<div className="">
<div className="flex h-[450px] justify-center bg-primary/5 px-36 py-12">
<div className="flex h-[450px] justify-center gap-16 bg-primary/5 px-36 py-12">
<Image
src={data?.files[0].url || ''}
alt="place"
width={630}
width={530}
height={1}
className="rounded-lg"
/>
<div className="ml-auto pr-16 pt-52">
<p className="text-2">{data?.title}</p>
<p className="mb-4 text-h1 font-semibold">{data?.place}</p>
<div className="flex">
<Image src={LocationIcon} alt="LocationIcon" />
<div className="flex gap-2">
<Image
className="mb-auto mt-1"
src={LocationIcon}
alt="LocationIcon"
/>
<p className="text-2">주소 : {data?.address}</p>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/app/(route)/(user)/(with-layout)/workation/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ const UserWkDetailPage = ({ params }: UserWkDetailProps) => {
alt="place"
/>
<div className="ml-8 flex-col">
<p className="mb-3 text-sub-300">{data.title}</p>
<h2 className="mb-12 text-h2 font-semibold text-sub-400">
<p className="mb-4 text-sub-300">{data.title}</p>
<h2 className="mb-20 text-h2 font-semibold text-sub-400">
{data.place}
</h2>
<p className="mb-4 inline-block rounded-regular border border-primary bg-primary/10 px-5 py-1.5 text-3 text-primary">
<p className="mb-5 inline-block rounded-regular border border-primary bg-primary/10 px-5 py-1.5 text-3 text-primary">
모집인원 : {data.totalRecruit}
</p>
<p className="mb-0.5">
Expand Down
17 changes: 8 additions & 9 deletions src/app/(route)/admin/(with-layout)/members/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SearchingBoxModule from '@/_components/common/modules/SearchingBoxModule'
import TableContainer from '@/_components/common/containers/TableContainer';
import PaginationModule from '@/_components/common/modules/PaginationModule';
import RadioButtonContainer from '@/_components/common/containers/RadioButtonContainer';
import { membersOrderList, teamList } from '@/_types/adminType';
import { membersOrderList } from '@/_types/adminType';
import CheckboxContainer from '@/_components/common/containers/CheckboxContainer';
import FilteringBarContainer from '@/_components/common/containers/FilteringBarContainer';
import TableHeaderModule from '@/_components/common/modules/TableHeaderModule';
Expand All @@ -18,6 +18,7 @@ import TableBodyAtom from '@/_components/common/atoms/TableBodyAtom';
import ShowDetailButtonAtom from '@/_components/common/atoms/ShowDetailButtonAtom';
import { useGetMemberListQuery } from '@/_hooks/admin/useGetMemberListQuery';
import { MembersSearchQueryOptions } from '@/_constants/common';
import { departmentConverter, departmentList } from '@/_types/commonType';

const AdminMembersListPage = () => {
const router = useRouter();
Expand All @@ -27,8 +28,8 @@ const AdminMembersListPage = () => {
order: string;
departmentType: string[];
}>({
order: 'NAME',
departmentType: ['MANAGEMENT', 'SALES', 'MARKETING', 'PROMOTION', 'DEV'],
order: 'name,ASC',
departmentType: departmentList,
});

const [selectedOption, setSelectedOption] = useState(
Expand All @@ -47,8 +48,8 @@ const AdminMembersListPage = () => {
const refreshHandler = () => {
setParam({
...param,
order: 'NAME',
departmentType: ['MANAGEMENT', 'SALES', 'MARKETING', 'PROMOTION', 'DEV'],
order: 'name,ASC',
departmentType: departmentList,
});
};

Expand Down Expand Up @@ -88,7 +89,7 @@ const AdminMembersListPage = () => {
<hr className="h-[0.5px] w-full border-0 bg-sub-100" />
<CheckboxContainer
title="소속"
options={Object.entries(teamList) as [string, string][]}
options={Object.entries(departmentConverter) as [string, string][]}
selectedOptions={param.departmentType}
setSelectedOptions={(departmentType: string[]) =>
setParam({ ...param, departmentType })
Expand All @@ -115,9 +116,7 @@ const AdminMembersListPage = () => {
<EmptyContainer colSpan={7} text="no data" />
)
) : data.pageInfo.totalElements <= 0 ? (
<div>
<EmptyContainer colSpan={7} />
</div>
<EmptyContainer colSpan={7} />
) : (
data.memberInfos.map((item, index) => (
<TableBodyModule key={item.accountId}>
Expand Down
13 changes: 1 addition & 12 deletions src/app/(route)/admin/(with-layout)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ import { useState } from 'react';
import { useGetPointApply } from '@/_hooks/admin/useGetPointApply';
import { pointApplyTypeConvertList } from '@/_types/adminType';

const pointData = [
{
id: 1,
구분: '봉사활동',
이름: '홍길동',
신청일시: '2024.07.03',
심사일시: '2024.07.05',
상태: { text: '지급 완료', color: 'blue' },
},
];

const AdminMainPage = () => {
const router = useRouter();
const [statusOption, setStatusOption] = useState<{
Expand Down Expand Up @@ -126,7 +115,7 @@ const AdminMainPage = () => {
) : (
wkData.wktInfos.map((item, index) => (
<TableBodyModule key={item.wktId}>
<TableBodyAtom isFirst>{item.wktId}</TableBodyAtom>
<TableBodyAtom isFirst>{index + 1}</TableBodyAtom>
<TableBodyAtom>{item.wktPlaceTitle}</TableBodyAtom>
<TableBodyAtom>
{dayjs(item.applyStartDate).format('YYYY.MM.DD')} -
Expand Down
14 changes: 9 additions & 5 deletions src/app/(route)/admin/(with-layout)/points/reward/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import TableHeaderModule from '@/_components/common/modules/TableHeaderModule';
import TitleBarModule from '@/_components/common/modules/TitleBarModule';
import { useGetPointPolicyQuery } from '@/_hooks/admin/useGetPointPolicyQuery';
import { useGetPointSupplyQuery } from '@/_hooks/admin/useGetPointSupplyQuery';
import { orderList, pointRewardList } from '@/_types/adminType';
import {
orderList,
pointRewardList,
rewardOrderList,
} from '@/_types/adminType';
import { DatePickerTagType } from '@/_types/commonType';
import dayjs from 'dayjs';
import { useRouter } from 'next/navigation';
Expand All @@ -35,15 +39,15 @@ const AdminPointsRewardPage = () => {
type: string[];
reason: string[];
}>({
order: 'ASC',
order: 'createdAt,DESC',
type: ['PERSONAL', 'GROUP'],
reason: [],
});

const refreshHandler = () => {
setParam({
...param,
order: 'ASC',
order: 'createdAt,DESC',
type: ['PERSONAL', 'GROUP'],
reason: [],
});
Expand Down Expand Up @@ -78,7 +82,7 @@ const AdminPointsRewardPage = () => {
pageParam: {
page: currentPage,
size: 10,
sort: `createdAt,${param.order}`,
sort: param.order,
},
});

Expand Down Expand Up @@ -178,7 +182,7 @@ const AdminPointsRewardPage = () => {
>
<RadioButtonContainer
title="정렬"
options={Object.entries(orderList) as [string, string][]}
options={Object.entries(rewardOrderList) as [string, string][]}
selectedOption={param.order}
setSelectedOption={(order: string) => setParam({ ...param, order })}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,17 @@ const WorkationEdit = ({ params }: WkEditProps) => {
<TitleBarModule title="워케이션 수정" type="LEFT" />
<div className="mt-10 flex flex-col gap-[30px]">
<div className="flex h-52 gap-x-8">
<Image src={placeImsy} alt="placeImsy" />
<Image
src={data?.files[0].url || ''}
width={400}
height={300}
alt="place"
/>
<div className="w-full">
<div className="flex w-full gap-6">
<div className="w-full">
<InputModule
textCount={20}
textCount={30}
placeholder="제목을 입력하세요"
subtitle="제목"
value={values.title}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(route)/admin/(with-layout)/workation/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const WorkationList = () => {
) : (
data.wktInfos.map((item, index) => (
<TableBodyModule key={item.wktId}>
<TableBodyAtom isFirst>{item.wktId}</TableBodyAtom>
<TableBodyAtom isFirst>{index + 1}</TableBodyAtom>
<TableBodyAtom>{item.title}</TableBodyAtom>
<TableBodyAtom>
{dayjs(item.createdAt).format('YYYY.MM.DD')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const InfoSectionContainer = ({
title,
row,
}: InfoSectionContainerProps) => {
const widthValue = row ? 300 : '100%'; // width, height 재설정해야함
const widthValue = row ? 330 : '100%'; // width, height 재설정해야함
return (
<div className="w-full rounded-regular border border-stroke-100 bg-cus-100 px-4 py-5">
{title && <p className="mb-7 text-1 font-bold">{title}</p>}
<div className={`flex ${row ? 'items-center gap-10' : 'flex-col gap-7'}`}>
{image && (
<Image
className="max-h-[210px] min-h-[210px] min-w-[330px] max-w-[330px]"
width={typeof widthValue === 'number' ? widthValue : undefined}
height={100}
src={image}
Expand Down
Loading

0 comments on commit ae9904e

Please sign in to comment.