diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..cfa91da --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,48 @@ +name: Trigger Web Deploy + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + trigger-deploy: + runs-on: ubuntu-latest + + env: + PR_TITLE: ${{ github.event.pull_request.title || '' }} + COMMIT_MESSAGE: ${{ github.event.head_commit.message || '' }} + FINAL_TITLE: ${{ github.event.pull_request.title || github.event.head_commit.message }} + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Clean Commit Message + id: clean-message + run: | + CLEAN_TITLE=$(echo "${{ env.FINAL_TITLE }}" | tr -d '\000-\031') + echo "CLEAN_TITLE=$CLEAN_TITLE" >> $GITHUB_ENV + + - name: Trigger Deploy + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.GIT_ACCESS_TOKEN }} + repository: team-b1nd/web-deploy-config + event-type: trigger-deploy + client-payload: | + { + "repo_name": "${{ github.repository }}", + "branch": "${{ github.ref }}", + "source_directory": "./build", + "project_name": "dodam", + "destination_directory": "/", + "config_secret": "${{ secrets.CONFIG_JSON }}", + "title": "${{ env.CLEAN_TITLE }}", + "package_manager_config_command": "npm config set registry=https://npm.pkg.github.com/Team-B1ND && npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GIT_ACCESS_TOKEN }} && npm config set //registry.npmjs.org/:_authToken=${{ secrets.GIT_ACCESS_TOKEN }}", + "package_manager": "npm" + } diff --git a/src/components/common/Layout/index.tsx b/src/components/common/Layout/index.tsx index 412d00e..27ce894 100644 --- a/src/components/common/Layout/index.tsx +++ b/src/components/common/Layout/index.tsx @@ -1,5 +1,5 @@ import { ReactNode } from "react"; -import DarkmodeButton from "../DarkmodeButton"; +// import DarkmodeButton from "../DarkmodeButton"; import Header from "../Header"; import Nav from "../Nav"; import * as S from "./style"; diff --git a/src/hooks/recruit/useModifyRecruit.ts b/src/hooks/recruit/useModifyRecruit.ts index 1187ecd..9446e17 100644 --- a/src/hooks/recruit/useModifyRecruit.ts +++ b/src/hooks/recruit/useModifyRecruit.ts @@ -80,7 +80,7 @@ const useModifyRecruit = ({ recruitId }: Props) => { pdfs, }); } - }, [serverRecruitData, setImgUrl, recruitId]); + }, [serverRecruitData, setImgUrl, recruitId, setRecruitPdf, setModifyRecruitData]); const modifyJobSelection = (job: string) => { if (!selectModifJob.includes(job)) { diff --git a/src/hooks/recruit/useUploadRecruitImage.ts b/src/hooks/recruit/useUploadRecruitImage.ts index 2b1da18..296ea3d 100644 --- a/src/hooks/recruit/useUploadRecruitImage.ts +++ b/src/hooks/recruit/useUploadRecruitImage.ts @@ -54,7 +54,7 @@ const useUploadRecruitImage = () => { ); } }, - [postUploadMutation, setRecruitPdfData, setModifyRecruitData] + [postUploadMutation, id, setRecruitPdfData, setModifyRecruitData, setImgUrl] ); const UploadThumbnail = useCallback( @@ -86,7 +86,7 @@ const useUploadRecruitImage = () => { } ); }, - [postUploadMutation, setImgUrl] + [postUploadMutation, setModifyRecruitData, id, setImgUrl] ); const handleDeletePdf = (id: number) => { diff --git a/src/hooks/recruit/useWriteRecruit.ts b/src/hooks/recruit/useWriteRecruit.ts index d4f0de3..cdad189 100644 --- a/src/hooks/recruit/useWriteRecruit.ts +++ b/src/hooks/recruit/useWriteRecruit.ts @@ -62,7 +62,7 @@ const useWriteRecruit = () => { return; } - if (selectJob == undefined) { + if (selectJob === undefined) { B1ndToast.showInfo("직무를 선택해주세요"); } postRecruitMutation.mutate( diff --git a/src/lib/storage/Cookie.ts b/src/lib/storage/Cookie.ts index 44811a8..4967b00 100644 --- a/src/lib/storage/Cookie.ts +++ b/src/lib/storage/Cookie.ts @@ -12,5 +12,5 @@ class Cookie implements Storage { cookie.remove(key); } } - -export default new Cookie(); +const cookies = new Cookie(); +export default cookies; diff --git a/src/lib/token/Token.ts b/src/lib/token/Token.ts index 8956f59..a1a5632 100644 --- a/src/lib/token/Token.ts +++ b/src/lib/token/Token.ts @@ -34,5 +34,5 @@ class Token { this.storage.remove(REFRESH_TOKEN_KEY); } } - -export default new Token(Cookie); +const token = new Token(Cookie); +export default token; diff --git a/src/repositories/MemberRepoistory/MemberRepositoryImpl.ts b/src/repositories/MemberRepoistory/MemberRepositoryImpl.ts index 646305a..d634b8f 100644 --- a/src/repositories/MemberRepoistory/MemberRepositoryImpl.ts +++ b/src/repositories/MemberRepoistory/MemberRepositoryImpl.ts @@ -7,5 +7,5 @@ class MemberRepositoryImpl implements MemberRepository { return data; } } - -export default new MemberRepositoryImpl(); +const memberRepository = new MemberRepositoryImpl(); +export default memberRepository; diff --git a/src/repositories/RecruitRepository/RecruitRepositoryImpl.ts b/src/repositories/RecruitRepository/RecruitRepositoryImpl.ts index 9808ad1..8a9c77d 100644 --- a/src/repositories/RecruitRepository/RecruitRepositoryImpl.ts +++ b/src/repositories/RecruitRepository/RecruitRepositoryImpl.ts @@ -40,5 +40,5 @@ class RecruitRepositoryImpl implements RecruitRepository { await customAxios.delete(`/recruit/${id}`); } } - -export default new RecruitRepositoryImpl(); +const recruitRepositoryImpl = new RecruitRepositoryImpl(); +export default recruitRepositoryImpl; diff --git a/src/repositories/TokenRepository/TokenRepositoryImpl.ts b/src/repositories/TokenRepository/TokenRepositoryImpl.ts index 8fad1ce..5ffbfb2 100644 --- a/src/repositories/TokenRepository/TokenRepositoryImpl.ts +++ b/src/repositories/TokenRepository/TokenRepositoryImpl.ts @@ -13,5 +13,5 @@ class TokenRepositoryImpl implements TokenRepository { return data; } } - -export default new TokenRepositoryImpl(); +const tokenRepository = new TokenRepositoryImpl(); +export default tokenRepository; diff --git a/src/repositories/UploadRepository/UploadRepositoryImpl.ts b/src/repositories/UploadRepository/UploadRepositoryImpl.ts index 3eabf7d..ebd16c6 100644 --- a/src/repositories/UploadRepository/UploadRepositoryImpl.ts +++ b/src/repositories/UploadRepository/UploadRepositoryImpl.ts @@ -13,5 +13,5 @@ class UploadRepositoryImpl implements UploadRepository { return data; } } - -export default new UploadRepositoryImpl(); +const uploadRepositoryImpl = new UploadRepositoryImpl(); +export default uploadRepositoryImpl;