[FIX] 커뮤니티 버그 수정 #137
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: Build and Deploy with Gradle | |
on: | |
push: | |
branches: [ "develop" ] | |
pull_request: | |
branches: [ "develop" ] | |
jobs: | |
build: | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 | |
- name: Build with Gradle Wrapper | |
run: ./gradlew war | |
- name: Deploy to development server | |
uses: Dylan700/sftp-upload-action@latest | |
with: | |
server: ${{ secrets.DEV_SSH_HOST }} | |
username: ${{ secrets.DEV_SSH_ID }} | |
password: ${{ secrets.DEV_SSH_PASSWORD }} | |
port: 22 | |
uploads: | | |
./build/libs/ => /root/apache-tomcat-10.1.24/build-target/ | |
- name: Change old WAR to new WAR | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEV_SSH_HOST }} | |
username: ${{ secrets.DEV_SSH_ID }} | |
password: ${{ secrets.DEV_SSH_PASSWORD }} | |
port: 22 | |
script: | | |
cd /root/apache-tomcat-10.1.24/webapps/ | |
rm -rf server server.war | |
mv ../build-target/meltingpot.war server.war | |
service tomcat restart |