Merge pull request #11 from boostcampwm-2024/feature/BE-redis #4
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: Backend Deploy | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| paths: | |
| - "backend/**" | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Setup SSH | |
| run: | | |
| echo "${{ secrets.SSH_PEM_KEY }}" >> /tmp/deploy_key.pem && \ | |
| chmod 400 /tmp/deploy_key.pem && \ | |
| eval "$(ssh-agent -s)" && \ | |
| ssh-add /tmp/deploy_key.pem | |
| - name: Deploy to server | |
| run: | | |
| ssh -i /tmp/deploy_key.pem -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} << EOF | |
| echo "Connected to the server" | |
| cd /root/refactor-web14-betting-duck | |
| git pull origin dev | |
| cd /root/refactor-web14-betting-duck/backend | |
| docker restart betting_duck_app | |
| EOF | |
| - name: Notify deployment status | |
| if: success() | |
| run: echo "Deployment succeeded." | |
| - name: Notify deployment failure | |
| if: failure() | |
| run: echo "Deployment failed." |