chore: update server yaml timeout and command timeout setting #13
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: PlatCode Backend (Golang) | |
| on: | |
| push: | |
| branches: ['main'] | |
| pull_request: | |
| branches: ['main'] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Deploy to cloud server | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: 22 | |
| timeout: 5m | |
| command_timeout: 20m | |
| script: | | |
| set -e | |
| echo "=== Clone/Update Repo ===" | |
| if [ ! -d ~/PlateCode ]; then | |
| git clone https://github.com/WhatNext-ID/plate-code-detector ~/PlateCode | |
| fi | |
| cd ~/PlateCode | |
| git pull origin main | |
| echo "=== Build & Deploy ===" | |
| cd plate-server | |
| docker compose down --remove-orphans | |
| docker compose --project-name plate-code up --build -d | |
| echo "=== Cleanup ===" | |
| docker image prune -f |