Spaces:
Running
Running
| name: Deploy to Production | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| name: Deploy to Oracle Cloud | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Deploy via SSH | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ${{ secrets.SERVER_USER }} | |
| key: ${{ secrets.SERVER_SSH_KEY }} | |
| port: 22 | |
| script: | | |
| set -e | |
| cd /opt/tebyan | |
| echo "ββ Pulling latest code ββ" | |
| git pull origin main | |
| echo "ββ Building and restarting ββ" | |
| docker compose -f docker-compose.prod.yml build --pull --no-cache backend frontend | |
| docker compose -f docker-compose.prod.yml up -d | |
| echo "ββ Waiting for health checks ββ" | |
| sleep 15 | |
| curl -sf http://localhost/health | python3 -m json.tool | |
| echo "ββ Deploy complete ββ" | |
| docker compose -f docker-compose.prod.yml ps | |