Merge pull request #5 from boostcampwm-2024/feature/2 #1
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: Frontend Deploy | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| paths: | |
| - "frontend/**" | |
| 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 | |
| docker exec betting_duck_app sh -c "cd /app/frontend && pnpm install && pnpm build" | |
| EOF | |
| - name: Notify deployment status | |
| if: success() | |
| run: echo "Deployment succeeded." | |
| - name: Notify deployment failure | |
| if: failure() | |
| run: echo "Deployment failed." |