Merge pull request #27 from ChainSafe/facilitator-integration #44
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies (including dev) | |
| run: uv sync --all-extras | |
| - name: Run linting | |
| run: uv run ruff check . | |
| - name: Run type checking | |
| run: uv run mypy src/ | |
| continue-on-error: true # Don't fail on type errors yet | |
| - name: Run tests | |
| run: uv run pytest tests/ -v | |
| continue-on-error: true # Don't fail on test errors yet (no tests written) | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker compose build | |
| - name: Verify image was built | |
| run: docker images | grep canton-mcp-server | |
| deploy: | |
| needs: [test, docker] | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to production server | |
| env: | |
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
| SSH_HOST: 91.99.186.83 | |
| SSH_USER: devops | |
| run: | | |
| # Setup SSH | |
| mkdir -p ~/.ssh | |
| echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts | |
| # Deploy via SSH | |
| ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST << 'ENDSSH' | |
| set -e | |
| cd /opt/canton-mcp-server || cd ~/canton-mcp-server | |
| echo "📦 Pulling latest code..." | |
| # Stash any local changes and force sync with main | |
| git fetch origin | |
| git stash || true | |
| git reset --hard origin/main | |
| echo "🐋 Rebuilding and restarting containers..." | |
| docker compose down | |
| docker compose up -d --build | |
| echo "✅ Deployment complete!" | |
| docker compose ps | |
| ENDSSH | |