Merge pull request #107 from MLAI-AUS-Inc/codex/domain-scan-routing-fix #104
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: Deploy to Digital Ocean | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy via SSH | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.DO_HOST }} | |
| username: ${{ secrets.DO_USERNAME }} | |
| key: ${{ secrets.DO_SSH_KEY }} | |
| script: | | |
| # Stop if any command fails | |
| set -e | |
| # Define deployment directory | |
| DEPLOY_DIR="/root/roo" | |
| # Clone repo if it doesn't exist, otherwise pull | |
| if [ ! -d "$DEPLOY_DIR" ]; then | |
| echo "Cloning repository..." | |
| git clone https://github.com/MLAI-AUS-Inc/roo.git "$DEPLOY_DIR" | |
| else | |
| echo "Updating repository..." | |
| cd "$DEPLOY_DIR" | |
| git pull origin main | |
| fi | |
| # Go to the sub-project directory | |
| cd "$DEPLOY_DIR/roo-standalone" | |
| # Restart the app | |
| docker compose up -d --build --remove-orphans | |
| # Clean up space | |
| docker image prune -f |