chore: eports 경기 일정 코드 통일화 작업 #137
This file contains hidden or 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
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| # This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created | |
| # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle | |
| name: 🚀 개발 배포 | |
| on: | |
| pull_request: | |
| types: [ closed ] | |
| branches: [ "dev" ] | |
| push: | |
| branches: [ "dev" ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| DB_ENDPOINT: ${{ secrets.DEV_DB_ENDPOINT }} | |
| DB_NAME: ${{ secrets.DEV_DB_NAME }} | |
| DB_PASSWORD: ${{ secrets.DEV_DB_PASSWORD }} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: 🔨 JDK 17 세팅 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: 🔨 gradlew 실행 권한 설정 | |
| run: chmod +x gradlew | |
| - name: 🔨 Gradle 캐시 설정 | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: 🔨 Gradle 빌드 | |
| run: ./gradlew build --parallel | |
| - name: 📦 배포 파일 준비 | |
| run: | | |
| mkdir -p before-deploy | |
| cp ./build/libs/*.jar ./before-deploy/ | |
| cp ./appspec.yml ./before-deploy/ | |
| cp -r ./scripts/dev/ ./before-deploy/scripts/ | |
| zip -r deploy.zip before-deploy/ | |
| - name: 📤 EC2에 파일 업로드 | |
| uses: appleboy/scp-action@v0.1.5 | |
| with: | |
| host: ${{ secrets.AWS_SERVER_IP }} | |
| username: ubuntu | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| source: "deploy.zip" | |
| target: "/home/ubuntu" | |
| - name: 🚀 EC2에서 배포 스크립트 실행 | |
| uses: appleboy/ssh-action@v1.0.0 | |
| with: | |
| host: ${{ secrets.AWS_SERVER_IP }} | |
| username: ubuntu | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| script: | | |
| unzip -o /home/ubuntu/deploy.zip -d /home/ubuntu | |
| rm -rf /home/ubuntu/app/* | |
| mv /home/ubuntu/before-deploy/* /home/ubuntu/app/ | |
| chmod +x /home/ubuntu/app/scripts/*.sh | |
| /home/ubuntu/app/scripts/run_new_was.sh | |
| rm -rf /home/ubuntu/deploy.zip /home/ubuntu/before-deploy |