액션 추가 #21
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: FAST API CI/CD | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 체크아웃 레포지토리 | |
| uses: actions/checkout@v3 | |
| # 하나의 SSH 액션으로 모든 배포 작업 수행 | |
| - name: 전체 배포 프로세스 | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ${{ secrets.SERVER_USER }} | |
| password: ${{ secrets.SERVER_PASSWORD }} | |
| script: | | |
| cd ${{ secrets.APP_DIR }} | |
| git pull origin main | |
| # 도커 컴포즈로 서비스 실행 | |
| docker compose down | |
| docker compose up -d --build |