fix :: 포트 바인딩 수정 #3
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
| # main 브랜치 push 시 SSH로 원격 서버에 접속해 배포 스크립트 실행 | |
| name: Deploy via SSH | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up SSH key | |
| uses: webfactory/ssh-agent@v0.8.0 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Add remote host to known_hosts | |
| run: | | |
| ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | |
| - name: Deploy via SSH | |
| env: | |
| USERNAME: ${{ secrets.SSH_USERNAME }} | |
| HOST: ${{ secrets.SSH_HOST }} | |
| run: | | |
| ssh $USERNAME@$HOST 'cd ~/Clocker/backend && bash ./deploy.sh' |