From 66c9c8f5d15c69657462aceefaf92d7c1eb9209f Mon Sep 17 00:00:00 2001 From: Jonathan Norris Date: Thu, 31 Jul 2025 16:25:03 -0400 Subject: [PATCH 1/2] chore: adding worker-deploy action --- .github/workflows/worker-deploy.yml | 75 +++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/worker-deploy.yml diff --git a/.github/workflows/worker-deploy.yml b/.github/workflows/worker-deploy.yml new file mode 100644 index 000000000..f31440d6d --- /dev/null +++ b/.github/workflows/worker-deploy.yml @@ -0,0 +1,75 @@ +name: Deploy MCP Worker + +on: + push: + branches: + - main + paths: + - 'mcp-worker/**' + - '.github/workflows/worker-deploy.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + name: Deploy to Cloudflare Workers + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Check for worker changes + id: changes + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "changed=true" >> $GITHUB_OUTPUT + else + git diff --name-only HEAD^ HEAD > changed_files.txt + if grep -q "^mcp-worker/" changed_files.txt || grep -q "worker-deploy.yml" changed_files.txt; then + echo "changed=true" >> $GITHUB_OUTPUT + else + echo "changed=false" >> $GITHUB_OUTPUT + fi + fi + + - name: Skip deployment - no worker changes + if: steps.changes.outputs.changed == 'false' + run: echo "No changes detected in mcp-worker directory, skipping deployment" + + - name: Enable Corepack + if: steps.changes.outputs.changed == 'true' + run: corepack enable + + - name: Setup Node.js + if: steps.changes.outputs.changed == 'true' + uses: actions/setup-node@v4 + with: + node-version: 22.12 + cache: 'yarn' + + - name: Install dependencies + if: steps.changes.outputs.changed == 'true' + run: yarn install + + - name: Build worker + if: steps.changes.outputs.changed == 'true' + run: yarn build:worker + + - name: Deploy to Cloudflare Workers + if: steps.changes.outputs.changed == 'true' + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + workingDirectory: mcp-worker + secrets: | + AUTH0_CLIENT_ID + AUTH0_CLIENT_SECRET + env: + AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }} + AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }} \ No newline at end of file From afb9965538fef2d34dc9b86ea7eb64fd2252a106 Mon Sep 17 00:00:00 2001 From: Jonathan Norris Date: Thu, 31 Jul 2025 16:27:08 -0400 Subject: [PATCH 2/2] chore: update deploy script --- .github/workflows/worker-deploy.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/worker-deploy.yml b/.github/workflows/worker-deploy.yml index f31440d6d..0ae4c47ef 100644 --- a/.github/workflows/worker-deploy.yml +++ b/.github/workflows/worker-deploy.yml @@ -30,7 +30,7 @@ jobs: echo "changed=true" >> $GITHUB_OUTPUT else git diff --name-only HEAD^ HEAD > changed_files.txt - if grep -q "^mcp-worker/" changed_files.txt || grep -q "worker-deploy.yml" changed_files.txt; then + if grep -q "^mcp-worker/" changed_files.txt || grep -q "^src/mcp/" changed_files.txt || grep -q "worker-deploy.yml" changed_files.txt; then echo "changed=true" >> $GITHUB_OUTPUT else echo "changed=false" >> $GITHUB_OUTPUT @@ -49,7 +49,7 @@ jobs: if: steps.changes.outputs.changed == 'true' uses: actions/setup-node@v4 with: - node-version: 22.12 + node-version: 22 cache: 'yarn' - name: Install dependencies @@ -69,7 +69,4 @@ jobs: workingDirectory: mcp-worker secrets: | AUTH0_CLIENT_ID - AUTH0_CLIENT_SECRET - env: - AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }} - AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }} \ No newline at end of file + AUTH0_CLIENT_SECRET \ No newline at end of file