[fix]#25 - deploy.yml overwrite: true 추가 #76
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: Deploy to EC2 with Docker | |
| on: | |
| push: | |
| branches: [main, fix/#25-회원로직버그] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Build JAR | |
| run: ./gradlew clean build -x test | |
| - name: Copy JAR to EC2 | |
| uses: appleboy/scp-action@v0.1.3 | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ec2-user | |
| key: ${{ secrets.EC2_KEY }} | |
| source: "build/libs/TagCafe-0.0.1-SNAPSHOT.jar" | |
| target: "/home/ec2-user/app/" | |
| overwrite: true | |
| - name: SSH into EC2 and deploy | |
| uses: appleboy/ssh-action@v0.1.10 | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ec2-user | |
| key: ${{ secrets.EC2_KEY }} | |
| script: | | |
| cd /home/ec2-user/app | |
| docker-compose down | |
| docker-compose up -d |