Skip to content

Commit

Permalink
Merge pull request #256 from mash-up-kr/develop
Browse files Browse the repository at this point in the history
Release v1.4.0 배포
  • Loading branch information
Baek2back authored Jul 29, 2023
2 parents 493c3ef + 9582f63 commit e836f61
Show file tree
Hide file tree
Showing 23 changed files with 147 additions and 190 deletions.
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.

16 changes: 0 additions & 16 deletions src/components/recruit/PlatformStudy/PlatformStudy.component.tsx

This file was deleted.

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

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/recruit/PlatformTalent/PlatformTalent.component.tsx

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit e836f61

Please sign in to comment.