Skip to content

Commit

Permalink
feat :: git action
Browse files Browse the repository at this point in the history
  • Loading branch information
ftery0 committed Nov 11, 2024
1 parent 6189213 commit 65e938c
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 17 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion src/components/common/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/recruit/useModifyRecruit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/recruit/useUploadRecruitImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const useUploadRecruitImage = () => {
);
}
},
[postUploadMutation, setRecruitPdfData, setModifyRecruitData]
[postUploadMutation, id, setRecruitPdfData, setModifyRecruitData, setImgUrl]
);

const UploadThumbnail = useCallback(
Expand Down Expand Up @@ -86,7 +86,7 @@ const useUploadRecruitImage = () => {
}
);
},
[postUploadMutation, setImgUrl]
[postUploadMutation, setModifyRecruitData, id, setImgUrl]
);

const handleDeletePdf = (id: number) => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/recruit/useWriteRecruit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const useWriteRecruit = () => {
return;
}

if (selectJob == undefined) {
if (selectJob === undefined) {
B1ndToast.showInfo("직무를 선택해주세요");
}
postRecruitMutation.mutate(
Expand Down
4 changes: 2 additions & 2 deletions src/lib/storage/Cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ class Cookie implements Storage {
cookie.remove(key);
}
}

export default new Cookie();
const cookies = new Cookie();
export default cookies;
4 changes: 2 additions & 2 deletions src/lib/token/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions src/repositories/MemberRepoistory/MemberRepositoryImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ class MemberRepositoryImpl implements MemberRepository {
return data;
}
}

export default new MemberRepositoryImpl();
const memberRepository = new MemberRepositoryImpl();
export default memberRepository;
4 changes: 2 additions & 2 deletions src/repositories/RecruitRepository/RecruitRepositoryImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ class RecruitRepositoryImpl implements RecruitRepository {
await customAxios.delete(`/recruit/${id}`);
}
}

export default new RecruitRepositoryImpl();
const recruitRepositoryImpl = new RecruitRepositoryImpl();
export default recruitRepositoryImpl;
4 changes: 2 additions & 2 deletions src/repositories/TokenRepository/TokenRepositoryImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ class TokenRepositoryImpl implements TokenRepository {
return data;
}
}

export default new TokenRepositoryImpl();
const tokenRepository = new TokenRepositoryImpl();
export default tokenRepository;
4 changes: 2 additions & 2 deletions src/repositories/UploadRepository/UploadRepositoryImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ class UploadRepositoryImpl implements UploadRepository {
return data;
}
}

export default new UploadRepositoryImpl();
const uploadRepositoryImpl = new UploadRepositoryImpl();
export default uploadRepositoryImpl;

0 comments on commit 65e938c

Please sign in to comment.