3:I[5613,[],""] 5:I[1778,[],""] 6:I[2581,["250","static/chunks/250-9edeb9d2171db55c.js","185","static/chunks/app/layout-051d49746254c3f8.js"],""] 4:["slug","learning/backend/change-auto-deploy","c"] 0:["YFd_7cSmvIuy-EBayyLo2",[[["",{"children":[["slug","learning/backend/change-auto-deploy","c"],{"children":["__PAGE__?{\"slug\":[\"learning\",\"backend\",\"change-auto-deploy\"]}",{}]}]},"$undefined","$undefined",true],["",{"children":[["slug","learning/backend/change-auto-deploy","c"],{"children":["__PAGE__",{},["$L1","$L2",null]]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","$4","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/b14273d44a3cc3aa.css","precedence":"next","crossOrigin":""}]]}]]},[null,["$","html",null,{"lang":"ko","children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n\t\t\t\t\tconst saved = window.localStorage.getItem(\"data-theme\");\n\t\t\t\t\tif (saved) {\n\t\t\t\t\t\tif (saved === \"dark\") {\n\t\t\t\t\t\t\tdocument.documentElement.setAttribute(\"data-theme\", \"dark\");\n\t\t\t\t\t\t} else if (saved === \"light\") {\n\t\t\t\t\t\t\tdocument.documentElement.setAttribute(\"data-theme\", \"light\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdocument.documentElement.setAttribute(\"data-theme\", \"light\");\n\t\t\t\t\t}\n\t\t\t\t"}}]}],["$","body",null,{"children":["$","$L6",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}]]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a3a92ccd642ec2bc.css","precedence":"next","crossOrigin":""}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/6f7575626860276e.css","precedence":"next","crossOrigin":""}]],"$L7"]]]] 8:I[2664,["250","static/chunks/250-9edeb9d2171db55c.js","839","static/chunks/839-022cf7a9ced654a8.js","877","static/chunks/app/%5B...slug%5D/page-0ab240b8cea332e0.js"],""] 9:I[1749,["250","static/chunks/250-9edeb9d2171db55c.js","839","static/chunks/839-022cf7a9ced654a8.js","877","static/chunks/app/%5B...slug%5D/page-0ab240b8cea332e0.js"],"Image"] 2:["$","div",null,{"className":"style_container__fKKke","children":[["$","$L8",null,{}],["$","div",null,{"className":"style_post__b12XM","children":[["$","div",null,{"className":"style_headerWords__W9tOe","id":"headerWords","children":["$","div",null,{"className":"style_container__kC8fE","children":[["$","div",null,{"className":"style_title__RVWQ2","children":"Github Actions 자동 배포 방식 변경하기"}],["$","div",null,{"className":"style_description__dS1rF","children":"Docker Compose를 이용한 기존 방식에서 Github Actions에서 jar 파일 빌드 후 서버에서 실행하는 방식으로 변경해보기"}]]}]}],["$","div",null,{"className":"style_time__vHpWr","children":"2024. 9. 8."}],["$","div",null,{"className":"style_title__mMA8e","children":"Github Actions 자동 배포 방식 변경하기"}],["$","div",null,{"className":"style_description__XJTFe","children":"Docker Compose를 이용한 기존 방식에서 Github Actions에서 jar 파일 빌드 후 서버에서 실행하는 방식으로 변경해보기"}],["$","div",null,{"className":"style_border__x5cYB","id":"headLine"}],["$","div",null,{"className":"style_contentStyle__Yta8A","children":[[["$","h1",null,{"id":"목차","className":"style_heading__KYLdz style_heading1__0P2Vc","children":"목차"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","ul",null,{"className":"style_ul__SYxQ0","children":["\n",["$","li",null,{"className":"style_li__17u78","children":["$","a",null,{"href":"#%EC%9A%B0%EB%A6%AC-%EC%84%9C%EB%B2%84%EA%B0%80-%EB%A7%8E%EC%9D%B4-%EC%95%84%ED%8C%8C%EC%9A%94","children":"우리 서버가 많이 아파요","className":"style_a__MgrUe"}]}],"\n",["$","li",null,{"className":"style_li__17u78","children":[["$","a",null,{"href":"#%EB%B0%B0%ED%8F%AC-%EC%84%A4%EC%A0%95-%EB%B3%80%EA%B2%BD%ED%95%98%EA%B8%B0","children":"배포 설정 변경하기","className":"style_a__MgrUe"}],"\n",["$","ul",null,{"className":"style_ul__SYxQ0","children":["\n",["$","li",null,{"className":"style_li__17u78","children":["$","a",null,{"href":"#checkout-%EC%88%98%ED%96%89","children":"checkout 수행","className":"style_a__MgrUe"}]}],"\n",["$","li",null,{"className":"style_li__17u78","children":["$","a",null,{"href":"#applicationproperties-%EC%98%AE%EA%B8%B0%EA%B8%B0","children":"application.properties 옮기기","className":"style_a__MgrUe"}]}],"\n",["$","li",null,{"className":"style_li__17u78","children":["$","a",null,{"href":"#jdk-%EC%84%A4%EC%A0%95-%EB%B0%8F-%EB%B9%8C%EB%93%9C-%EC%88%98%ED%96%89","children":"JDK 설정 및 빌드 수행","className":"style_a__MgrUe"}]}],"\n",["$","li",null,{"className":"style_li__17u78","children":["$","a",null,{"href":"#%EB%B9%8C%EB%93%9C%EB%90%9C-jar-%ED%8C%8C%EC%9D%BC%EC%9D%84-%EB%B0%B0%ED%8F%AC-%EC%84%9C%EB%B2%84%EC%97%90-%EC%98%AE%EA%B8%B0%EA%B8%B0","children":"빌드된 jar 파일을 배포 서버에 옮기기","className":"style_a__MgrUe"}]}],"\n",["$","li",null,{"className":"style_li__17u78","children":["$","a",null,{"href":"#ssh%EB%A1%9C-%EB%B0%B0%ED%8F%AC-%EC%84%9C%EB%B2%84%EC%97%90%EC%84%9C-jar-%ED%8C%8C%EC%9D%BC-%EC%8B%A4%ED%96%89%ED%95%98%EA%B8%B0","children":"SSH로 배포 서버에서 jar 파일 실행하기","className":"style_a__MgrUe"}]}],"\n"]}],"\n"]}],"\n",["$","li",null,{"className":"style_li__17u78","children":["$","a",null,{"href":"#%EC%A0%84%EC%B2%B4-yml-%EC%BD%94%EB%93%9C","children":"전체 yml 코드","className":"style_a__MgrUe"}]}],"\n"]}],"\n",[["$","h1",null,{"id":"우리-서버가-많이-아파요","className":"style_heading__KYLdz style_heading1__0P2Vc","children":"우리 서버가 많이 아파요"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":"현재 진행중인 프로젝트에서 백엔드 스프링 부트 서버는 내 오라클 클라우드 개인 서버에서 Docker Compose를 이용해 배포를 하는 중이다."}],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["내 서버가 4코어 CPU에 24GB 램이라는 아주 여유로운 사양을 가지고 있는 서버라서 지금까지 배포에는 아무런 문제도 없었지만, PM과 최종 Production 배포 환경을 구상해보니 금액면에서 사양이 매우 낮은 서버를 사용할 수 밖에 없게 되었다... 😭",["$","br",null,{}],"\n","해당 서버의 사양이 Docker의 최소사양은 간신히 넘기긴 하는데 말그대로 ",["$","strong",null,{"className":"style_strong__ip7oe","children":"최소"}],"사양이라 상황에 따라 Production에 큰 영향을 줄 수 있을거라고 판단했고, Docker를 이용한 마이크로서비스 배포는 포기하게 되었다."]}],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":"그리고 현재로서는 빌드를 수행하는 곳이 실제 배포가 되는 서버인데, 앞으로 변경될 서버는 낮은 사양으로 인해 정상적인 빌드를 수행하기 힘들 것이기 때문에 Github Actions의 서버에서 빌드를 수행하는 방식으로 변경해야 했다."}],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":"따라서 Github Actions 배포 설정을 전체적으로 변경하게 되었다."}],"\n",[["$","h1",null,{"id":"배포-설정-변경하기","className":"style_heading__KYLdz style_heading1__0P2Vc","children":"배포 설정 변경하기"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":"이전 설정 파일은 아래와 같다."}],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Auto Deploy with Docker Compose"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#569CD6"},"children":"on"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"push"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"branches"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"main"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#569CD6"},"children":"jobs"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"deploy"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"runs-on"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"ubuntu-latest"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Execute remote SSH commands"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"appleboy/ssh-action@v1.0.3"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"with"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"host"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_HOST }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"username"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_USER }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"key"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_KEY }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"port"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_PORT }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"script"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#C586C0"},"children":"|"}]]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" cd ${{ secrets.PROJECT_PATH }}"}]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" docker compose down"}]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" git pull origin main"}]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" docker compose up -d --build"}]}]]}]}]}],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["배포 서버에 SSH로 접근한 뒤 기존 Docker Compose로 올린 스프링 부트 서버 컨테이너와 DB 서버 컨테이너를 전부 내리고 ",["$","code",null,{"children":"git pull"}]," 로 코드를 업데이트 한뒤 image를 빌드하여 다시 올리는 작업을 수행했다."]}],"\n",[["$","h2",null,{"id":"checkout-수행","className":"style_heading__KYLdz style_heading2__HKlKs","children":"checkout 수행"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["Github Actions 서버에서 빌드를 수행할 것이므로 해당 서버에 레포지토리의 소스코드를 전달해야 한다.",["$","br",null,{}],"\n","이 작업은 Github에서 공식적으로 제공하는 ",["$","code",null,{"children":"checkout"}]," 액션을 사용해 쉽게 설정 가능하다."]}],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Checkout code"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"actions/checkout@v4"}]]}]]}]}]}],"\n",[["$","h2",null,{"id":"applicationproperties-옮기기","className":"style_heading__KYLdz style_heading2__HKlKs","children":"application.properties 옮기기"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["현재 프로젝트에서는 DB 연결 정보나 JWT secret key같은 secret한 정보를 담고 있는 application.properties 설정 파일을 따로 분리해 관리하고 있는데, 이것들은 gitignore 처리가 되었기 때문에 checkout 액션으로 서버에 넣어줄 수가 없다.",["$","br",null,{}],"\n","따라서 Github 레포의 설정에서 Github Action에 사용되는 secrets를 생성해 분리된 application.properties 설정 파일 내용을 저장하고, 저장된 secrets를 ",["$","code",null,{"children":"echo"}]," 명령어를 통해 파일로 저장해 지정된 경로에 넣어야 했다.",["$","br",null,{}],"\n","secrets는 Github 레포 페이지의 Settings > Secrets and variables > Actions 메뉴에서 생성하고 관리할 수 있다.",["$","br",null,{}],"\n",["$","div",null,{"className":"style_imageBox__6sQ34","children":[["$","$L9",null,{"src":"/learning/backend/change-auto-deploy/github-secrets.png","alt":"/learning/backend/change-auto-deploy/github-secrets.png","width":1000,"height":1000,"loading":"lazy","className":"style_img__fwG4y"}],["$","div",null,{"className":"style_description__GqC1z","children":"Settings > Secrets and variables > Actions"}]]}],["$","br",null,{}],"\n","이 secrets는 한번 저장하면 내용을 확인할 수 없고 수정을 하려고 해도 원본 내용이 보이지 않기 때문에 굉장히 안전해 보인다."]}],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Add application properties files"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"run"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#C586C0"},"children":"|"}]]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" echo \"${{ secrets.PRODUCTION_PROPERTIES }}\" > ./src/main/resources/application-prod.properties"}]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" echo \"${{ secrets.SECRET_PROPERTIES }}\" > ./src/main/resources/application-secret.properties"}]}]]}]}]}],"\n",[["$","h2",null,{"id":"jdk-설정-및-빌드-수행","className":"style_heading__KYLdz style_heading2__HKlKs","children":"JDK 설정 및 빌드 수행"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["이제 모든 소스코드가 서버에 올라갔으므로 빌드를 수행할 차례이다.",["$","br",null,{}],"\n","먼저 빌드를 수행할 수 있는 환경을 구성하기 위해 ",["$","strong",null,{"className":"style_strong__ip7oe","children":"JDK"}],"를 setup 해야 한다. 이것 역시 Github에서 제공하는 ",["$","code",null,{"children":"setup-java"}]," 액션을 사용해 쉽게 설정 가능하다."]}],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Set up JDK"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"actions/setup-java@v4"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"with"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"distribution"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"'corretto'"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"java-version"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"'17'"}]]}]]}]}]}],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["본 프로젝트의 스프링 부트는 Gradle을 사용하고 있으므로 gradlew를 이용해 빌드를 진행할 것이다.",["$","br",null,{}],"\n","빌드를 수행할 gradlew 파일의 접근권한을 설정하고 빌드를 수행한다."]}],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Grant execute permission for gradlew"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"run"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"chmod +x gradlew"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Build with Gradle"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"run"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"./gradlew build -x test"}]]}]]}]}]}],"\n",[["$","h2",null,{"id":"빌드된-jar-파일을-배포-서버에-옮기기","className":"style_heading__KYLdz style_heading2__HKlKs","children":"빌드된 jar 파일을 배포 서버에 옮기기"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["빌드가 끝나면 jar 파일을 생성되는데, 배포를 진행하려면 이 파일을 Github Actions 서버에서 실제 배포할 서버로 옮기는 과정이 필요하다.",["$","br",null,{}],"\n","이 과정은 ",["$","code",null,{"children":"appleboy/scp-action"}]," 액션으로 설정 가능하다. SSH 접속에 필요한 정보들을 secrets에 저장해 넣어주고 Gtihub Actions 서버에서 전달할 파일을 ",["$","code",null,{"children":"source"}]," 부분에 적고, 실제 배포할 서버에 어느 경로에 저장할 지를 ",["$","code",null,{"children":"target"}]," 부분에 적는다.",["$","br",null,{}],"\n","이때 ",["$","code",null,{"children":"source"}]," 부분에 적힌 경로 전체가 복사되어 전달되는데, 전달할 파일이 여러 폴더 내부에 있을 경우 그 폴더 구조까지 옮겨지기 때문에 jar 파일만 필요한 경우에는 ",["$","code",null,{"children":"strip_components"}]," 부분으로 앞의 폴더 구조를 가지치기하는 과정이 필요하다. ",["$","code",null,{"children":"strip_components"}],"가 2라는 것은 ",["$","code",null,{"children":"source"}]," 부분의 build, libs 폴더의 2 계층을 없앤다는 것이다."]}],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Copy JAR to Server"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"appleboy/scp-action@v0.1.7"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"with"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"host"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_HOST }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"username"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_USER }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"key"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_KEY }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"port"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_PORT }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"source"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"./build/libs/*.jar"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"target"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.PROJECT_PATH }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"strip_components"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#B5CEA8"},"children":"2"}]]}]]}]}]}],"\n",[["$","h2",null,{"id":"ssh로-배포-서버에서-jar-파일-실행하기","className":"style_heading__KYLdz style_heading2__HKlKs","children":"SSH로 배포 서버에서 jar 파일 실행하기"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":["이전 배포 설정에서도 있었던 부분인데, 이번에는 SSH로 배포 서버에 접속한 후 Docker Compose를 이용하지 않고 ",["$","code",null,{"children":"nohup"}]," 명령어로 jar 파일만 실행하도록 만든다.",["$","br",null,{}],"\n","그리고 스프링 실행으로 발생되는 로그들을 log 파일에 저장되도록 설정하였다."]}],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Execute remote SSH commands"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"appleboy/ssh-action@v1.0.3"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"with"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"host"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_HOST }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"username"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_USER }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"key"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_KEY }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"port"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_PORT }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"script"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#C586C0"},"children":"|"}]]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" cd ${{ secrets.PROJECT_PATH }}"}]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" nohup java -Dspring.profiles.active=prod -jar deploy.jar >> deploy.log 2>&1 &"}]}]]}]}]}],"\n",["$","div",null,{"className":"style_p__L5AWZ","children":"nohup 명령어에서,"}],"\n",["$","ul",null,{"className":"style_ul__SYxQ0","children":["\n",["$","li",null,{"className":"style_li__17u78","children":">> : 발생한 로그들을 파일에 덮어씌우지 않고 이어서 저장하도록 하기"}],"\n",["$","li",null,{"className":"style_li__17u78","children":"2>&1 : 표준 출력이 전달되는 곳으로 표준 에러를 전달하도록 하기"}],"\n",["$","li",null,{"className":"style_li__17u78","children":"& : 백그라운드로 실행되도록 하기"}],"\n"]}],"\n",[["$","h1",null,{"id":"전체-yml-코드","className":"style_heading__KYLdz style_heading1__0P2Vc","children":"전체 yml 코드"}],["$","div",null,{"className":"style_border__h4ej3"}]],"\n",["$","div",null,{"data-rehype-pretty-code-fragment":"","children":["$","pre",null,{"className":"dark-plus","style":{"backgroundColor":"#1E1E1E"},"tabIndex":"0","data-language":"yml","data-theme":"default","children":["$","code",null,{"data-language":"yml","data-theme":"default","style":{"display":"grid"},"children":[["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Auto Deploy with Docker Compose"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#569CD6"},"children":"on"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"push"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"branches"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"main"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#569CD6"},"children":"jobs"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"deploy"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"runs-on"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"ubuntu-latest"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"steps"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Checkout code"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"actions/checkout@v4"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Add application properties files"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"run"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#C586C0"},"children":"|"}]]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" echo \"${{ secrets.PRODUCTION_PROPERTIES }}\" > ./src/main/resources/application-prod.properties"}]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" echo \"${{ secrets.SECRET_PROPERTIES }}\" > ./src/main/resources/application-secret.properties"}]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Set up JDK"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"actions/setup-java@v4"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"with"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"distribution"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"'corretto'"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"java-version"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"'17'"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Grant execute permission for gradlew"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"run"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"chmod +x gradlew"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Build with Gradle"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"run"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"./gradlew build -x test"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Copy JAR to Server"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"appleboy/scp-action@v0.1.7"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"with"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"host"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_HOST }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"username"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_USER }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"key"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_KEY }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"port"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_PORT }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"source"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"./build/libs/*.jar"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"target"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.PROJECT_PATH }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"strip_components"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#B5CEA8"},"children":"2"}]]}],"\n",["$","span",null,{"data-line":"","children":" "}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" - "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"name"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"Execute remote SSH commands"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"uses"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"appleboy/ssh-action@v1.0.3"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"with"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":":"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"host"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_HOST }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"username"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_USER }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"key"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_KEY }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"port"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#CE9178"},"children":"$${{ secrets.SSH_PORT }}"}]]}],"\n",["$","span",null,{"data-line":"","children":[["$","span",null,{"style":{"color":"#D4D4D4"},"children":" "}],["$","span",null,{"style":{"color":"#569CD6"},"children":"script"}],["$","span",null,{"style":{"color":"#D4D4D4"},"children":": "}],["$","span",null,{"style":{"color":"#C586C0"},"children":"|"}]]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" cd ${{ secrets.PROJECT_PATH }}"}]}],"\n",["$","span",null,{"data-line":"","children":["$","span",null,{"style":{"color":"#CE9178"},"children":" nohup java -Dspring.profiles.active=prod -jar deploy.jar >> deploy.log 2>&1 &"}]}]]}]}]}]]}]]}]]}] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Github Actions 자동 배포 방식 변경하기 | Temple's Hideout"}],["$","meta","3",{"name":"description","content":"Docker Compose를 이용한 기존 방식에서 Github Actions에서 jar 파일 빌드 후 서버에서 실행하는 방식으로 변경해보기"}],["$","meta","4",{"property":"og:title","content":"Github Actions 자동 배포 방식 변경하기 | Temple's Hideout"}],["$","meta","5",{"property":"og:description","content":"Docker Compose를 이용한 기존 방식에서 Github Actions에서 jar 파일 빌드 후 서버에서 실행하는 방식으로 변경해보기"}],["$","meta","6",{"property":"og:image","content":"https://blog.templ.es/opengraph/learning/backend/change-auto-deploy"}],["$","meta","7",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","8",{"name":"twitter:title","content":"Github Actions 자동 배포 방식 변경하기 | Temple's Hideout"}],["$","meta","9",{"name":"twitter:description","content":"Docker Compose를 이용한 기존 방식에서 Github Actions에서 jar 파일 빌드 후 서버에서 실행하는 방식으로 변경해보기"}],["$","meta","10",{"name":"twitter:image","content":"https://blog.templ.es/opengraph/learning/backend/change-auto-deploy"}],["$","link","11",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","12",{"name":"next-size-adjust"}]] 1:null