Skip to content

[fix]#25 - deploy.yml overwrite: true 추가 #76

[fix]#25 - deploy.yml overwrite: true 추가

[fix]#25 - deploy.yml overwrite: true 추가 #76

Workflow file for this run

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