ci : redis 버전 배포 #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: coffee-prod-deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main", "release" ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
# 서버에 파일 복사 (빌드된 JAR 배포) | |
- name: Deploy to Server1 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} # 서버 IP | |
username: ${{ secrets.SERVER_USER }} # 서버 사용자 이름 | |
password: ${{ secrets.SERVER_PASSWORD }} # 서버 비밀번호 | |
source: build/libs/*.jar | |
target: /app | |
- name: Deploy to Server2 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST2 }} # 서버 IP | |
username: ${{ secrets.SERVER_USER }} # 서버 사용자 이름 | |
password: ${{ secrets.SERVER_PASSWORD }} # 서버 비밀번호 | |
source: build/libs/*.jar | |
target: /app | |
# Spring Boot 애플리케이션 실행 (Optional) | |
- name: Restart Spring Boot Application | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USER }} | |
password: ${{ secrets.SERVER_PASSWORD }} | |
script: | | |
/app/deploy.sh | |
- name: Restart Spring Boot Application2 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST2 }} | |
username: ${{ secrets.SERVER_USER }} | |
password: ${{ secrets.SERVER_PASSWORD }} | |
script: | | |
/app/deploy.sh |