Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/deploy-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
paths-ignore:
- '**.md'
- '.gitignore'
workflow_run:
workflows: ["Sync main to dev"]
types:
- completed

env:
REGISTRY: ghcr.io
Expand All @@ -15,6 +19,9 @@ env:

jobs:
build-server:
if: >
github.event_name == 'push' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
uses: ./.github/workflows/build-push-image.yaml
permissions:
contents: read
Expand All @@ -23,7 +30,7 @@ jobs:
service: mcp-server
registry: ghcr.io
image_name: ${{ github.repository }}
tag: dev-${{ github.sha }}
tag: dev-${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
additional_tag: dev-latest

deploy:
Expand All @@ -36,6 +43,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_run' && 'dev' || github.ref }}

- name: Set up kubeconfig
run: |
Expand All @@ -45,7 +54,7 @@ jobs:

- name: Update deployment files
run: |
TAG="dev-${{ github.sha }}"
TAG="dev-${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}"
sed -i "s|image: ghcr.io/${{ env.IMAGE_NAME }}/mcp-server:.*|image: ghcr.io/${{ env.IMAGE_NAME }}/mcp-server:${TAG}|" deploy/01_server.yaml

- name: Deploy to Kubernetes
Expand Down