배포 v1.3.5 #12
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 ELK To EC2 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ELK/** | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Github Repo Checkout | |
| uses: actions/checkout@v4 | |
| - name: Connect To EC2 | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ secrets.EC2_HOST_DB }} | |
| username: ${{ secrets.EC2_USER }} | |
| key: ${{ secrets.EC2_PRIVATE_KEY }} | |
| script: | | |
| # 1. Git Repo 디렉토리 이동 | |
| cd ~/MLOps | |
| # 2. 코드 최신화 | |
| git pull origin main | |
| # 3. docker compose | |
| cd ./ELK | |
| docker compose stop elasticsearch-init elasticsearch kibana elk-api || true | |
| docker compose rm -f elasticsearch-init elasticsearch kibana elk-api || true | |
| docker compose up -d --build |