feat: workflow 수정 #2
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: OnPyRunner deploy | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create SSH Key | |
| run: | | |
| echo "${{ secrets.SSH_PRIV_KEY }}" > ~/private-key.pem | |
| chmod 600 ~/private-key.pem | |
| - name: Add known host | |
| run: | | |
| mkdir -p ~/.ssh | |
| ssh-keyscan -p ${{ secrets.PORT }} ${{ secrets.HOST }} >> ~/.ssh/known_hosts | |
| - name: Execute Pull on Remote Server | |
| run: | | |
| ssh -i ~/private-key.pem -p ${{ secrets.PORT }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} << 'EOF' | |
| cd OnPyRunner/ | |
| git pull origin main | |
| docker compose down | |
| docker compose up -d --build --scale worker=2 | |
| EOF |