File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy React App to EC2 via Docker Compose
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - feature/build
8+ workflow_dispatch :
9+
10+ jobs :
11+ deploy :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout source
16+ uses : actions/checkout@v4
17+
18+ - name : Upload files to EC2
19+ uses : appleboy/scp-action@v0.1.7
20+ with :
21+ host : ${{ secrets.EC2_HOST }}
22+ username : ${{ secrets.EC2_USER }}
23+ key : ${{ secrets.EC2_SSH_KEY }}
24+ source : " ."
25+ target : " ~/ground-hub/frontend/frontend_build/OVERLAB_FE-feature-build/front-end" # 배포 위치 (원하는 경로로 변경 가능)
26+
27+ - name : SSH to EC2 and deploy
28+ uses : appleboy/ssh-action@v1.0.3
29+ with :
30+ host : ${{ secrets.EC2_HOST }}
31+ username : ${{ secrets.EC2_USER }}
32+ key : ${{ secrets.EC2_SSH_KEY }}
33+ script : |
34+ cd ~/ground-hub/docker
35+ docker-compose -f docker-compose.yml down frontend || true
36+ docker compose -f docker-compose.yml build frontend
37+ docker compose -f docker-compose.yml up frontend -d
You can’t perform that action at this time.
0 commit comments