Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.4.0 배포 #256

Merged
merged 19 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
636a8cc
Env: QA 빌드 대상을 develop 브랜치로 변경한다
Baek2back Jul 29, 2023
f300e68
Merge pull request #250 from mash-up-kr/env/deploy-action
Baek2back Jul 29, 2023
04ef1f3
Env: editorjs -> HTML로 변환을 수행하기 위한 패키지를 추가한다
Baek2back Jul 29, 2023
a29d770
Refactor: 사용되지 않는 컴포넌트를 제거한다
Baek2back Jul 29, 2023
487ac2f
Env: 어드민 API 요청을 위해 필요한 환경변수를 정의한다
Baek2back Jul 29, 2023
f14cd54
Feat: 어드민 API 서비스 클래스를 정의한다
Baek2back Jul 29, 2023
106bb54
Feat: CMS 데이터를 이용해 UI를 렌더링하도록 변경한다
Baek2back Jul 29, 2023
c7532ba
Refactor: path 추론 시 적용하는 로직을 간소화한다
Baek2back Jul 29, 2023
a425f10
Merge pull request #251 from mash-up-kr/feature/recruit-cms
Baek2back Jul 29, 2023
2fc8c6f
Env: 어드민 API 경로를 환경변수로 정의한다
Baek2back Jul 29, 2023
1d4d0a9
Refactor: 서버에서 사용될 axios 인스턴스를 대응한다
Baek2back Jul 29, 2023
e763077
Merge pull request #252 from mash-up-kr/feature/recruit-cms
Baek2back Jul 29, 2023
9c5d002
Env: DEV 환경 S3 Bucket 이름을 수정한다
Baek2back Jul 29, 2023
cde0582
Env: CODE DEPLOY 애플리케이션 이름을 수정한다
Baek2back Jul 29, 2023
fadbc2e
Merge pull request #253 from mash-up-kr/feature/recruit-cms
Baek2back Jul 29, 2023
efe39ad
Env: AWS Access Key, Secret을 DEPLOY로 변경한다
Baek2back Jul 29, 2023
241d6f1
Merge pull request #254 from mash-up-kr/feature/recruit-cms
Baek2back Jul 29, 2023
6b64af5
Feat: 개행을 처리하기 위해 p 태그의 최소 높이를 지정해준다
Baek2back Jul 29, 2023
9582f63
Merge pull request #255 from mash-up-kr/feature/recruit-cms
Baek2back Jul 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/main-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
echo "SOURCE_PATH=$SOURCE_PATH" >> .env.local
echo "NEXT_PUBLIC_CHANNEL_PLUGIN=$NEXT_PUBLIC_CHANNEL_PLUGIN" >> .env.local
echo "NEXT_PUBLIC_GOOGLE_ANALYTICS=$NEXT_PUBLIC_GOOGLE_ANALYTICS" >> .env.local
echo "ADMIN_DESTINATION_PATH=$ADMIN_DESTINATION_PATH" >> .env.local
echo "ADMIN_TOKEN=$ADMIN_TOKEN" >> .env.local
env:
ANALYZE: ${{ secrets.ANALYZE }}
BASE_URL: ${{ secrets.DEPLOY_BASE_URL }}
Expand All @@ -45,6 +47,8 @@ jobs:
SOURCE_PATH: ${{ secrets.SOURCE_PATH }}
NEXT_PUBLIC_CHANNEL_PLUGIN: ${{ secrets.NEXT_PUBLIC_CHANNEL_PLUGIN }}
NEXT_PUBLIC_GOOGLE_ANALYTICS: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS }}
ADMIN_DESTINATION_PATH: ${{ secrets.DEPLOY_ADMIN_DESTINATION_PATH }}
ADMIN_TOKEN: ${{ secrets.DEPLOY_ADMIN_TOKEN }}

- name: Install dependencies
run: yarn install
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/qa-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: dev-recruit CI/CD
on:
push:
branches:
- qa/*
- develop

env:
S3_BUCKET_NAME: dev-recruit.mash-up
CODE_DEPLOY_APPLICATION_NAME: dev-recruit-cd
S3_BUCKET_NAME: dev-recruit.mash-up.kr
CODE_DEPLOY_APPLICATION_NAME: dev-recruit-code-deploy
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: dev-recruit

jobs:
Expand All @@ -34,6 +34,8 @@ jobs:
echo "SOURCE_PATH=$SOURCE_PATH" >> .env.local
echo "NEXT_PUBLIC_CHANNEL_PLUGIN=$NEXT_PUBLIC_CHANNEL_PLUGIN" >> .env.local
echo "NEXT_PUBLIC_GOOGLE_ANALYTICS=$NEXT_PUBLIC_GOOGLE_ANALYTICS" >> .env.local
echo "ADMIN_DESTINATION_PATH=$ADMIN_DESTINATION_PATH" >> .env.local
echo "ADMIN_TOKEN=$ADMIN_TOKEN" >> .env.local
env:
ANALYZE: ${{ secrets.ANALYZE }}
BASE_URL: ${{ secrets.BASE_URL }}
Expand All @@ -45,6 +47,8 @@ jobs:
SOURCE_PATH: ${{ secrets.SOURCE_PATH }}
NEXT_PUBLIC_CHANNEL_PLUGIN: ${{ secrets.NEXT_PUBLIC_CHANNEL_PLUGIN }}
NEXT_PUBLIC_GOOGLE_ANALYTICS: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS }}
ADMIN_DESTINATION_PATH: ${{ secrets.ADMIN_DESTINATION_PATH }}
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}

- name: Install dependencies
run: yarn install
Expand All @@ -59,8 +63,8 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.DEPLOY_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEPLOY_AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Upload to S3
Expand Down
2 changes: 2 additions & 0 deletions @types/custom-types/process.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ declare namespace NodeJS {
NEXT_PUBLIC_CHANNEL_PLUGIN: string;
DESTINATION_URL: string;
SOURCE_PATH: string;
ADMIN_DESTINATION_PATH: string;
ADMIN_TOKEN: string;
}
}
1 change: 0 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const nextConfig = {
env: {
BASE_URL: process.env.BASE_URL,
},
// eslint-disable-next-line consistent-return
async rewrites() {
return [
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@next/bundle-analyzer": "^12.1.0",
"aos": "^3.0.0-beta.6",
"axios": "^0.26.0",
"editorjs-html": "^3.4.3",
"lodash-es": "^4.17.21",
"lottie-web": "^5.9.1",
"next": "12.3.4",
Expand Down
63 changes: 30 additions & 33 deletions pages/recruit/[platformName].tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
import { GetStaticPaths, GetStaticProps, NextPage } from 'next';
import { ParsedUrlQuery } from 'querystring';
import { PlatformKey, platformMap, platforms } from '@/constants';
import { PlatformKey, platformKeys, platformMap, platforms } from '@/constants';
import editorjsHTML from 'editorjs-html';
import { unescape, flow } from 'lodash-es';
import {
RecruitHeader,
PlatformHero,
Divider,
BottomNavigation,
NavigationHeader,
PlatformInformation,
PlatformTalent,
PlatformInterviewSchedule,
PlatformStudy,
ActionGroup,
RecruitLayout,
RecruitContents,
RecruitLayout,
ApplyLinkButton,
BulletedList,
ActionGroup,
RecruitEditorContainer,
SEO,
} from '@/components';
import { adminApiService } from '@/api/services';
import { objectKeys } from '@/utils/object';

interface Params extends ParsedUrlQuery {
platformName: PlatformKey;
}

interface PlatformProps {
platformName: PlatformKey;
html: string;
}

const Platform: NextPage<PlatformProps> = ({ platformName }) => {
const Platform: NextPage<PlatformProps> = ({ platformName, html }) => {
const {
name: currentPlatformName,
role: currentPlatformRole,
path: currentPlatformPath,
introduction: currentPlatformIntroduction,
study: currentPlatformStudy,
talent: currentPlatformTalent,
interview: currentPlatformInterview,
hero: currentPlatformHero,
} = platformMap[platformName];

Expand All @@ -50,18 +47,7 @@ const Platform: NextPage<PlatformProps> = ({ platformName }) => {
<PlatformHero color={currentPlatformHero.color} emojis={currentPlatformHero.emojis} />
<RecruitHeader name={currentPlatformName} role={currentPlatformRole} />
<RecruitContents>
<PlatformInformation name={currentPlatformName}>
{currentPlatformIntroduction}
</PlatformInformation>
<PlatformTalent>
<BulletedList items={currentPlatformTalent} />
</PlatformTalent>
<PlatformStudy>
<BulletedList items={currentPlatformStudy} />
</PlatformStudy>
<PlatformInterviewSchedule>
<BulletedList items={currentPlatformInterview} />
</PlatformInterviewSchedule>
<RecruitEditorContainer dangerouslySetInnerHTML={{ __html: html }} />
<ActionGroup>
<ApplyLinkButton applyPath={currentPlatformPath.apply} />
</ActionGroup>
Expand All @@ -74,26 +60,37 @@ const Platform: NextPage<PlatformProps> = ({ platformName }) => {
};

export const getStaticPaths: GetStaticPaths<Params> = async () => {
const paths = objectKeys(platformKeys).map((platformKey) => {
return { params: { platformName: platformKey } };
});

return {
paths: [
{ params: { platformName: 'ios' } },
{ params: { platformName: 'web' } },
{ params: { platformName: 'android' } },
{ params: { platformName: 'spring' } },
{ params: { platformName: 'design' } },
{ params: { platformName: 'node' } },
],
paths,
fallback: false,
};
};

export const getStaticProps: GetStaticProps<PlatformProps, Params> = async (context) => {
const { platformName } = context.params!;

const removeWrongAmpString = (value: string) => value.replace(/&amp;/g, '&');

const { data } = await adminApiService.getRecruitDataFromStorage({
accessToken: process.env.ADMIN_TOKEN,
key: platformName,
});

const html = editorjsHTML()
.parse(data.valueMap.editorData)
.map(flow(removeWrongAmpString, unescape))
.join('');

return {
props: {
platformName,
html,
},
revalidate: 60 * 60 * 24,
};
};

Expand Down
24 changes: 24 additions & 0 deletions src/api/services/admin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { StorageDataResponse, StorageDataRequest } from '@/types/dto';
import BaseApiService from './base';

class AdminApiService extends BaseApiService {
public constructor() {
super(undefined, process.env.ADMIN_DESTINATION_PATH);
}

public getRecruitDataFromStorage({
accessToken,
key,
}: StorageDataRequest): Promise<StorageDataResponse> {
return this.http
.get(`/storage/key/recruit-${key}`, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then(BaseApiService.handleResponse)
.catch(BaseApiService.handleError);
}
}

export default new AdminApiService();
4 changes: 2 additions & 2 deletions src/api/services/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import axios, { AxiosInstance, AxiosResponse } from 'axios';
abstract class BaseApiService {
protected readonly http: AxiosInstance;

protected constructor(protected readonly path?: string) {
protected constructor(protected readonly path?: string, protected readonly baseURL?: string) {
this.http = axios.create({
baseURL: `${process.env.BASE_URL ?? ''}/api/${path ?? ''}`,
baseURL: baseURL ?? `${process.env.BASE_URL ?? ''}/api/${path ?? ''}`,
headers: {
'Content-Type': 'application/json',
},
Expand Down
1 change: 1 addition & 0 deletions src/api/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as applicantApiService } from './applicant';
export { default as applicationApiService } from './application';
export { default as teamApiService } from './team';
export { default as adminApiService } from './admin';

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/recruit/PlatformStudy/PlatformStudy.styled.ts

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/recruit/PlatformTalent/PlatformTalent.styled.ts

This file was deleted.

Loading
Loading