Repository navigation
chore: add merge commits to fork-sync-ignore for audit hygiene #24
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: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main, upstream-sync-trial] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/upstream-sync-trial') && github.event_name == 'push' | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Tag previous image for rollback | |
| run: | | |
| docker pull ghcr.io/pmlabs-org/mcp-trello:latest || true | |
| docker tag ghcr.io/pmlabs-org/mcp-trello:latest \ | |
| ghcr.io/pmlabs-org/mcp-trello:previous || true | |
| docker push ghcr.io/pmlabs-org/mcp-trello:previous || true | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/pmlabs-org/mcp-trello:latest | |
| ghcr.io/pmlabs-org/mcp-trello:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Setup SSH agent | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }} | |
| - name: Add droplet to known hosts | |
| run: ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts | |
| - name: Deploy to droplet | |
| run: | | |
| ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} \ | |
| "cd /opt/pmin-mcpinfrastructure \ | |
| && docker compose pull trello \ | |
| && docker compose up -d --force-recreate trello" | |
| - name: Health check | |
| run: | | |
| for i in 1 2 3 4 5; do | |
| if curl -sf https://trello.mcp.pathfindermarketing.com.au/.well-known/oauth-authorization-server > /dev/null; then | |
| echo "Health check passed"; exit 0 | |
| fi | |
| echo "Attempt $i/5 — retrying in 15s..."; sleep 15 | |
| done | |
| echo "Health check failed"; exit 1 |