Skip to content

Commit

Permalink
[Feat]: action 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed May 31, 2024
1 parent d41e10f commit 6544822
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 28 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ jobs:
key: ${{ secrets.KEY }}
port: 22
script: |
docker rm -f $(docker ps -qa) # 기존에 실행되고 있는 도커 프로세스들을 제거합니다.
docker rmi $(docker images -q) # 기존에 존재하는 도커 이미지들을 제거합니다.
docker rm -f $(docker ps -qa) # 기존에 실행되고 있는 도커 프로세스들을 제거합니다. mysql 컨테이너는 제거하지 않습니다.
docker rmi $(docker images -q) # 기존에 사용되고 있는 도커 이미지들을 제거합니다. mysql 이미지는 제거하지 않습니다.
docker image prune -f # 사용하지 않는 도커 이미지들을 제거합니다.
docker-compose up -d # mysql 개발용 컨테이너를 실행합니다.
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}
docker run -d -p 80:8080 ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }} -e SPRING_PROFILES_ACTIVE=dev -e KAKAO_CLIENT_SECRET=${{ secrets.KAKAO_CLIENT_SECRET }} -e NAVER_CLIENT_SECRET=${{ secrets.NAVER_CLIENT_SECRET }} -e KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }}
docker run -d -p 80:8080 -e SPRING_PROFILES_ACTIVE=prod -e KAKAO_CLIENT_SECRET=${{ secrets.KAKAO_CLIENT_SECRET }} -e NAVER_CLIENT_SECRET=${{ secrets.NAVER_CLIENT_SECRET }} -e KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }} -e MYSQL_URL=${{ secrets.MYSQL_URL }} -e MYSQL_USERNAME=${{ secrets.MYSQL_USERNAME }} -e MYSQL_PASSWORD=${{ secrets.MYSQL_PASSWORD }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package org.haedal.zzansuni.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.haedal.zzansuni.core.api.ApiResponse;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

@RequiredArgsConstructor
@RestController
@Slf4j
public class HealthCheckController {
private final Environment env;

@GetMapping("/health")
public String healthCheck() {
return "ok";
return "ok" + Arrays.toString(env.getActiveProfiles());
}

}
11 changes: 10 additions & 1 deletion zzansuni-api-server/app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,13 @@ spring: # dev profile
spring: # prod profile
config:
activate:
on-profile: prod
on-profile: prod
datasource:
url: ${MYSQL_URL}
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
jpa:
hibernate:
ddl-auto: create
defer-datasource-initialization: true
sql.init.mode: always
42 changes: 21 additions & 21 deletions zzansuni-api-server/app/src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ INSERT INTO users (exp, created_at, last_modified_at, auth_token, email, nicknam
provider, role)
VALUES (0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', 'NAVER_HP6Yyh7SIkk8QS1VFtEylxrxo23UxNTBHcAjfTw-BHM', null,
'bayy', null, null, 'NAVER', 'ADMIN'),
(0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test1@a.c', 'testUser1',
(0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'manager@a.c', 'testUser1',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'MANAGER'),
(49, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, '[email protected]', '이원',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'),
Expand Down Expand Up @@ -43,64 +43,64 @@ VALUES (0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', 'NAVER_HP6Yyh7SIkk8QS1V
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'),
(31, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, '[email protected]', '효범',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', null, null, 'USER'),
(57, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test0@a.c', '기태',
(57, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt0@a.c', '기태',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/se/U2uEiDz/640/480',
null, 'USER'),
(28, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test1@a.c', '한서',
(28, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt1@a.c', '한서',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/se/MSVzesxY/640/480',
null, 'USER'),
(38, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test2@a.c', '승리',
(38, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt2@a.c', '승리',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/se/KUZmdj5Zn/640/480',
null, 'USER'),
(87, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test3@a.c', '찬석',
(87, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt3@a.c', '찬석',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=4114472343961600', null, 'USER'),
(76, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test4@a.c', '은현',
(76, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt4@a.c', '은현',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=4231310094630912', null, 'USER'),
(15, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test5@a.c', '성권',
(15, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt5@a.c', '성권',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=4323334812598272', null, 'USER'),
(21, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test6@a.c', '찬휘',
(21, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt6@a.c', '찬휘',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=8502500980162560', null, 'USER'),
(90, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test7@a.c', '충만',
(90, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt7@a.c', '충만',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/seed/IkQoFVE/640/480',
null, 'USER'),
(31, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test8@a.c', '태식',
(31, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt8@a.c', '태식',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=1946817203798016', null, 'USER'),
(13, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test9@a.c', '순규',
(13, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt9@a.c', '순규',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=1005792186597376', null, 'USER'),
(57, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test10@a.c', '성빈',
(57, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt10@a.c', '성빈',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com40/480?lock=5094699765334016', null, 'USER'),
(0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test11@a.c', '조슈',
(0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt11@a.c', '조슈',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=7842715689549824', null, 'USER'),
(0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test12@a.c', '성목',
(0, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt12@a.c', '성목',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/seed/T0GXvPB9C5/640/480',
null, 'USER'),
(65, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test13@a.c', '주엽',
(65, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt13@a.c', '주엽',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/sd/GTUgLFvuZ/640/480',
null, 'USER'),
(79, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test14@a.c', '지섭',
(79, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt14@a.c', '지섭',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', 'https://picsum.photos/sd/HqevoSPB/640/480',
null, 'USER'),
(9, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test15@a.c', '혜승',
(9, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt15@a.c', '혜승',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com/0/480?lock=3226888453488640', null, 'USER'),
(15, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test16@a.c', '모세',
(15, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt16@a.c', '모세',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com40/480?lock=929401032146944', null, 'USER'),
(64, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test17@a.c', '혁주',
(64, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt17@a.c', '혁주',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com40/480?lock=1474097934499840', null, 'USER'),
(64, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test18@a.c', '예솔',
(64, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt18@a.c', '예솔',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com40/480?lock=5535552531070976', null, 'USER'),
(38, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test19@a.c', '근영',
(38, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'testt19@a.c', '근영',
'$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK',
'https://loremflickr.com40/480?lock=7618880130252800', null, 'USER');

Expand Down

0 comments on commit 6544822

Please sign in to comment.