Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#91] CD파일 추가 #92

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 워크플로우 이름 지정함
name: Deploy

# develop브랜치에 push될 때마다 워크플로우가 실행됨
push:
branches: [ "develop" ]
#수동으로 트리거되게 함
workflow_dispatch: {}

#워크플로우의 작업을 설정함
jobs:
build:
#최신의 우분투 서버에서 실행됨
runs-on: ubuntu-latest
#delideli코드를 깃허브에서 제공해주는 서버에 내려받고 특정브랜치로 전환해줌
steps:
- uses: actions/checkout@v3
#JDK설치함 (아마존에서 무료로 제공하는 jdk버전 11설치)
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'corretto'
java-version: '11'
#jar파일 생성함
- name: build jar
run: ./gradlew bootJar
#jar파일을 다른 서버에 옮김
- name: move jar
run: scp -P 10122 delideli-0.0.1-SNAPSHOT.jar [email protected]:~/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서버 아이피와 포트를 노출시키지 않는 방법도 있을까요??

#파일 옮긴 서버에 접속
- name: connect to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: bash run_delideli.sh