Skip to content

Commit

Permalink
Merge branch 'fe-release' into dev-fe
Browse files Browse the repository at this point in the history
  • Loading branch information
qkdflrgs authored Oct 6, 2023
2 parents 92b68d9 + e75e5a4 commit 6424ddb
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 6 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/auto-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: issue-tracker auto deploy

on:
push:
branches: [ "fe-release" ]


permissions:
contents: read

env:
FE_WORKING_DIR: ./fe
FE_ENV_PATH: ./.env
FE_DOCKER_FILE_PATH: ./Dockerfile

jobs:

# job[2]: FRONTEND -> docker hub로 build & push
fe-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.FE_WORKING_DIR }}
steps:

# 1. Source 단계
- name: Checkout Source Code
uses: actions/checkout@v3

# Node 세팅
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

# 2. .env 파일 변경
- name: create .env File
run: |
echo "${{ secrets.ENV }}" > "${{ env.FE_ENV_PATH }}"
# 2. 도커파일 생성
- name: create Docker File
run: |
echo "${{ secrets.FE_DOCKER_FILE }}" > "${{ env.FE_DOCKER_FILE_PATH }}"

# 2. docker hub로 build & push
- name: docker build and push
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/team-5-second-hand-fe:latest .
docker push ${{ secrets.DOCKER_USERNAME }}/team-5-second-hand-fe:latest
# job[4]: EC2에서 docker 이미지 pull하고 실행
SSH-Transfer:
needs: [ fe-deploy ]
runs-on: ubuntu-latest
steps:
- name: SSH Transfer
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ubuntu
key: ${{ secrets.KEY }}
script: |
sudo docker-compose down -v
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/team-5-second-hand-fe:latest
sudo docker-compose up -d
sudo docker image prune -a -f
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

.idea/

.DS_Store
2 changes: 1 addition & 1 deletion fe/src/api/queryKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ export const QUERY_KEYS = {
CHAT_LIST: (memberId: number) => ['chatList', memberId],
CHAT_ROOM: (chatRoomId: number) => ['chatRoom', chatRoomId],
LIKE_CATEGORY: (memberId: number) => ['likeCategory', memberId],
};
};
2 changes: 1 addition & 1 deletion fe/src/components/ActionBar/PostBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ const Info = styled.div`
const Price = styled.span`
color: ${({ theme }) => theme.color.neutralTextStrong};
font: ${({ theme }) => theme.font.displayDefault16};
`;
`;
2 changes: 1 addition & 1 deletion fe/src/constants/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export const API_ENDPOINTS = {
USER_REGIONS: (memberId: number) => `/members/${memberId}/regions`,
CHAT_LIST: (memberId: number) => `/members/${memberId}/chats`,
CHAT_ROOM: (chatRoomId: number) => `/chats/${chatRoomId}`,
};
};
2 changes: 1 addition & 1 deletion fe/src/constants/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const PATH = {
CALLBACK: '/callback/:provider',
FALLBACK: '*',
GOBACK: -1,
};
};
2 changes: 1 addition & 1 deletion fe/src/hooks/usePageNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export const usePageNavigator = () => {
navigateToGoBack: () => navigate(PATH.GOBACK),
navigateToChatRoom: (chatRoomId: number) => navigate(`/chat/${chatRoomId}`),
};
};
};
2 changes: 1 addition & 1 deletion fe/src/pages/Product/DetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ const ProductStats = styled.p`
width: 100%;
font: ${({ theme: { font } }) => font.displayDefault12};
color: ${({ theme: { color } }) => color.neutralTextWeak};
`;
`;

0 comments on commit 6424ddb

Please sign in to comment.