Update main_merge.yml #13
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: Main Server Merge | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code. # Repo checkout | |
uses: actions/checkout@v3 | |
- name: Set application.properties from secrets | |
run: | | |
echo "${{ secrets.MAIN_APPLICATION_PROPERTIES }}" > src/main/resources/application.properties | |
- 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 | |
- name: remove plain.jar | |
run: rm -rf build/libs/*plain.jar | |
# - name: file copy | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: libs | |
# path: build/libs | |
- name: file upload | |
uses: appleboy/[email protected] | |
with: | |
username: ${{ secrets.MAIN_USERNAME }} | |
host: ${{ secrets.MAIN_HOST }} | |
key: ${{ secrets.MAIN_SSH_KEY }} | |
source: "build/libs/*.jar" | |
target: "/home/ubuntu/docker/java/test/jar" | |
- name: SSH and deploy | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.MAIN_HOST }} | |
username: ${{ secrets.MAIN_USERNAME }} | |
key: ${{ secrets.MAIN_SSH_KEY }} | |
timeout: 40s # 30초 기본 | |
script: | | |
docker-compose build readyvery | |
docker-compose up -d readyvery | |