스웨거 UI 경로 수정 및 cors 허용 경로 수정 #4
Workflow file for this run
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
| name: Spring Deploy on Merge to develop | |
| on: | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - develop | |
| paths: | |
| - 'BACK/spring-app/**' | |
| jobs: | |
| deploy: | |
| name: Deploy to EC2 | |
| if: github.event.pull_request.merged == true # PR이 머지된 경우만 실행 | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: deploy-spring | |
| cancel-in-progress: true # 이전 실행 중인 워크플로를 취소 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up SSH | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| ssh-keyscan -H "${{ vars.EC2_HOST }}" >> ~/.ssh/known_hosts | |
| - name: Execute Deployment Script on EC2 | |
| run: | | |
| ssh ec2-user@${{ vars.EC2_HOST }} << 'EOF' | |
| cd /home/ec2-user/starchive/scripts | |
| git checkout develop | |
| # 스프링 배포 스크립트 실행 | |
| ./spring-deploy.sh | |
| EOF |