Merge pull request #41 from decocms/feat/registry-collection-format #125
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 MCPs (Production) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| mcps: ${{ steps.detect.outputs.mcps }} | |
| has_changes: ${{ steps.detect.outputs.has_changes }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Need full history for git diff | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Detect changed MCPs | |
| id: detect | |
| run: | | |
| # Get the previous commit to compare against | |
| PREVIOUS_COMMIT="${{ github.event.before }}" | |
| # Detect changed MCPs | |
| CHANGED_MCPS=$(bun run scripts/detect-changed-mcps.ts "$PREVIOUS_COMMIT" HEAD) | |
| echo "Changed MCPs: $CHANGED_MCPS" | |
| # Set outputs | |
| echo "mcps=$CHANGED_MCPS" >> $GITHUB_OUTPUT | |
| # Check if array is not empty | |
| if [ "$CHANGED_MCPS" = "[]" ]; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| deploy: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.has_changes == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| mcp: ${{ fromJSON(needs.detect-changes.outputs.mcps) }} | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install Deco CLI | |
| run: bun install -g deco-cli | |
| - name: Deploy ${{ matrix.mcp }} | |
| run: bun run scripts/deploy.ts ${{ matrix.mcp }} | |
| env: | |
| DECO_DEPLOY_TOKEN: ${{ secrets.DECO_DEPLOY_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| GOOGLE_GENAI_API_KEY: ${{ secrets.GOOGLE_GENAI_API_KEY }} | |
| NANOBANANA_API_KEY: ${{ secrets.NANOBANANA_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| PINECONE_TOKEN: ${{ secrets.PINECONE_TOKEN }} | |
| PINECONE_INDEX: ${{ secrets.PINECONE_INDEX }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| APIFY_API_TOKEN: ${{ secrets.APIFY_API_TOKEN }} | |
| REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }} | |
| PERPLEXITY_API_KEY: ${{ secrets.PERPLEXITY_API_KEY }} | |
| - name: Notify success | |
| if: success() | |
| run: echo "✅ Successfully deployed ${{ matrix.mcp }} to production" | |
| - name: Notify failure | |
| if: failure() | |
| run: echo "❌ Failed to deploy ${{ matrix.mcp }}" |