Skip to content

Commit aea5f02

Browse files
authored
feat: workflow에 EC2 자동 배포 추가 (#78)
* feat: workflow에 EC2 자동 배포 추가 * chore: appleboy/ssh-action 최신버전으로 변경
1 parent 6bf41e9 commit aea5f02

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/release-workflow.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
uses: actions/checkout@v4
5050

5151
- name: Setting for Developent
52-
run: echo "${{ secrets.APPLICATION_DEV_YML }}" > src/main/resources/application-dev.yml
52+
run: |
53+
mkdir -p src/main/resources
54+
echo "${{ secrets.APPLICATION_DEV_YML }}" > src/main/resources/application-dev.yml
5355
5456
- name: Sign in github container registry
5557
uses: docker/login-action@v3
@@ -75,3 +77,22 @@ jobs:
7577
push: true
7678
tags: ${{ steps.meta.outputs.tags }}
7779
labels: ${{ steps.meta.outputs.labels }}
80+
81+
deploy:
82+
name: EC2 자동 배포
83+
runs-on: ubuntu-latest
84+
needs: build-image
85+
86+
steps:
87+
- name: EC2에 SSH로 접속 후 배포
88+
uses: appleboy/[email protected]
89+
with:
90+
host: ${{ secrets.EC2_HOST }}
91+
username: ${{ secrets.EC2_USERNAME }}
92+
key: ${{ secrets.EC2_SSH_KEY }}
93+
port: ${{ secrets.EC2_PORT }}
94+
script: |
95+
cd ${{ secrets.EC2_DEPLOY_DIR }}
96+
docker compose pull
97+
docker compose down
98+
docker compose up -d

0 commit comments

Comments
 (0)